3
我需要发送邮件才能重置密码,但每次单击按钮重置密码时都会出现此错误。我会后我下面的代码:SMTP - >错误:无法连接到服务器:无法找到套接字传输“ssl” - 您忘记在配置PHP时启用它吗? (0)
require_once('mailer/class.phpmailer.php');
$uri = 'http://'. $_SERVER['HTTP_HOST'] ;
$from_name = 'test';
$from = '[email protected]';
$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。任何帮助将非常感激。谢谢