Php电子邮件激活

时间:2016-01-03 03:23:23

标签: php

您好在此脚本中,当用户在网站上注册时,他们会收到确认电子邮件/代码,但问题是用户从未收到它,我可以在mysql上手动激活它,存储激活密钥:

这是脚本,可能有什么问题?

/**
 * Sends activation email
 */
function notify_activation($user) {

  $app = \Slim\Slim::getInstance();
  
  $message = "Hello, <br>";
  
  $message .= '<br> To activate your <a href="'.app_url().'">' . get_config('appname') . '</a> account, please click the following link:<br>';
  
  $activation_link = app_url() . "/activate/" . $user->activation_token;
  
  $message .= '<a href="'.$activation_link.'">'.$activation_link.'</a>';

  $subject = get_config('appname') . " : Account Activation";
  
  mail($user->email, $subject, $message, get_notifier_headers(get_config('admin_email')));

}

以下是完整代码:https://dl.dropboxusercontent.com/s/rwobyfjwvwny91m/phpfile.txt.txt

0 个答案:

没有答案