【发布时间】:2016-03-14 06:50:21
【问题描述】:
我需要发送邮件来重设密码,但是每次单击按钮重设密码时都会出现此错误。我将在下面发布我的代码:
require_once('mailer/class.phpmailer.php');
$uri = 'http://'. $_SERVER['HTTP_HOST'] ;
$from_name = 'test';
$from = 'test@gmail.com';
$to = $email;
$to_name = 'test';
$message = 'Click on the given link to reset your password <a href="'.$uri.'/reset.php?token='.$token.'">Reset Password</a></p>';
$message .= 'Regards<br>';
$message .= 'test';
$mail = new PHPMailer();
$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
$mail->IsSMTP();
$mail->Port = 587; // or 587 // set mailer to use SMTP
$mail->Host = "ssl://smtp.mandrillapp.com"; // specify main and backup server
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = '****************'; // SMTP username
$mail->Password = '****************'; // SMTP password // SMTP account password
$mail->SetFrom($from,$from_name );
$mail->AddReplyTo($from,$from_name );
$mail->Subject = 'Password Change';
$mail->MsgHTML($message);
$mail->AddAddress($to,$to_name);
if(!$mail->Send())
{
echo "sorry!";
}
我看到一些帖子说我需要更改/取消注释用于 open_ssl.dll 的扩展。我在 php.ini 文件或 php-5.3.ini 中的任何地方都找不到该行。我在 Ubuntu 14.04 上使用 Ampps。任何帮助将非常感激。谢谢
【问题讨论】:
标签: php sockets email ssl smtp