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。任何幫助將非常感激。謝謝