【问题标题】:why php code sendmail is not sending activation-link to an email address?为什么 php 代码 sendmail 不向电子邮件地址发送激活链接?
【发布时间】:2014-06-30 08:04:01
【问题描述】:

对于电子邮件激活,我使用的是 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);

在第三个 $message 上,您可以从 2freewebhosting 中看到我的子域名,该子域名附有 confirmation.php,用于激活电子邮件地址,但此子域链接不允许我发送激活链接用户电子邮件地址。当我更改其中的任何域名时,它会发送邮件可能是什么原因?解决此问题的最佳方法是什么?我们到底应该在/confirmation.php之前放什么链接???

请帮帮我..!

【问题讨论】:

  • 为什么你不使用php mailer?
  • 我是新手,有什么办法可以制作吗?

标签: php mysql sendmail


【解决方案1】:

试试这个代码,

      $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);

【讨论】:

  • 你能告诉我 ashok sri 在 ______________/confirmation.php?passkey=$confirm_code 之前应该有什么以及为什么???
猜你喜欢
  • 1970-01-01
  • 2017-09-24
  • 1970-01-01
  • 2016-07-05
  • 2021-06-05
  • 2011-01-02
  • 2019-01-10
  • 2014-07-20
  • 2020-04-20
相关资源
最近更新 更多