以下发件人地址失败:webdeveloper.hadi@gmail.com:调用Mail()而未连接

时间:2016-04-14 17:52:36

标签: phpmailer

伙计我得到他的错误它正在工作@ localhost但在我的主机上不起作用

http://myownprojects.co.nf/ ?? 
$mail = new PHPMailer;
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->Host = 'smtp.gmail.com';
$mail->SMTPSecure = "ssl";
$mail->Port = 465;
$mail->IsHTML(true);
$mail->Username = "webdeveloper.hadi@gmail.com";
$mail->Password = '**********';
$mail->setFrom("webdeveloper.hadi@gmail.com");
$mail->Subject= "Your confirmation Mail";
$mail->AddEmbeddedImage('images/me.jpg', 'meimg', 'images/me.jpg');     
$mail->Body = "Please click on the link";
$mail->addAddress(webdeveloper.hadi@gmail.com);
if($mail->Send()){
}else{
}

1 个答案:

答案 0 :(得分:0)

尝试以下方法:

$mail->SMTPSecure = "tls";
$mail->Port = 587;