我有一个phpMailer的问题,我无法发送任何电子邮件,它给了我这个错误:
2016-03-03 21:32:09 SERVER -> CLIENT: 2016-03-03 21:32:09 SMTP NOTICE: EOF caught while checking if connected 2016-03-03 21:32:09 SMTP Error: Could not authenticate. 2016-03-03 21:32:09 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting Erreur : SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Run Code Online (Sandbox Code Playgroud)
这是我的代码:
<?php require('phpmailer/PHPMailerAutoload.php');
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = 'ssl://smtp.gmail.com';
$mail->SMTPAuth= true;
$mail->Username='myadress@gmail.com';
$mail->Password='passwordgmail';
$mail->Port = 587;
$mail->SMTPDebug = 2;
$mail->SMTPSecure = 'ssl';
$mail->SetFrom('myadress@gmail.com', 'Name');
$mail->AddAddress('someone@gmail.com', 'HisName');
$mail->Subject = 'Subject';
$mail->Subject = "Here is the subject";
$mail->Body = "This is the HTML message body …Run Code Online (Sandbox Code Playgroud)