Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么php代码sendmail不向电子邮件地址发送激活链接?_Php_Mysql_Sendmail - Fatal编程技术网

为什么php代码sendmail不向电子邮件地址发送激活链接?

为什么php代码sendmail不向电子邮件地址发送激活链接?,php,mysql,sendmail,Php,Mysql,Sendmail,对于电子邮件激活,我使用php Sendmail代码 我没有使用任何“Smtp或Php邮件程序函数”,而是使用了一个“变量”。每当我附加一个子域名与我的激活链接,它没有工作,没有邮件发送。但是当我在激活链接中附加域名时,它会工作并发送邮件。可能是什么原因导致子域名不发送邮件和相同的代码,而只是将子域名更改为域名可以正常工作并发送邮件。为什么? 这是我的代码: $to=$email; $subject="Your confirmation link here"; $header="from: Me

对于电子邮件激活,我使用php Sendmail代码

我没有使用任何“Smtp或Php邮件程序函数”,而是使用了一个“变量”。每当我附加一个子域名与我的激活链接,它没有工作,没有邮件发送。但是当我在激活链接中附加域名时,它会工作并发送邮件。可能是什么原因导致子域名不发送邮件和相同的代码,而只是将子域名更改为域名可以正常工作并发送邮件。为什么?

这是我的代码:

$to=$email;
$subject="Your confirmation link here";
$header="from: Meet Your Love<your email>";
$message="Your Comfirmation link \r\n";
$message.="Click on this link to activate your account \r\n";
$message.="http://meetyourlove.2fh.co/confirmation.php?passkey=$confirm_code";
$sentmail = mail($to,$subject,$message,$header);
$to=$email;
$subject=“此处的确认链接”;
$header=“from:遇见你的爱人”;
$message=“您的确认链接\r\n”;
$message.=“单击此链接以激活您的帐户\r\n”;
$message.=”http://meetyourlove.2fh.co/confirmation.php?passkey=$confirm_code“;
$sentmail=mail($to,$subject,$message,$header);
在第三条$message上,您可以从2freewebhosting中看到我的子域名,它附带了
confirmation.php
,用于激活电子邮件地址,但此子域名链接不允许我在用户电子邮件地址中发送激活链接。当我改变了它的任何域名,然后它发送邮件的原因可能是什么?什么是最好的办法来解决这个问题?我们应该在
/confirmation.php
之前放置什么链接

请帮帮我

试试这个代码

      $from="katrinakaif@love.com";
      $to ="yourmail@gmail.com";
      $confirm_code="13";
      $message="Your Comfirmation link \r\n";
      $message.="Click on this link to activate your account \r\n";
      $message.="http://meetyourlove.2fh.co/confirmation.php?passkey=$confirm_code";

       $subject="test";
       $headers  = 'MIME-Version: 1.0' . "\r\n";
       $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
       $headers .= 'From:'.$from . "\r\n";

     mail($to, $subject, $message, $headers);

为什么你不使用php mailer?我是新手,因为我不知道如何制作一个。你能告诉我ashok sri在\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu/confirmation.php之前应该有什么吗?passkey=$confirm\u代码,为什么???