我无法使用Office 365 smtp在wamp上发送来自php的电子邮件

时间:2016-01-17 10:21:06

标签: php smtp

function send_mail($email,$message,$subject)
{                       
    require_once('mailer/class.phpmailer.php');
    $mail = new PHPMailer();
    $mail->IsSMTP(); 
    $mail->SMTPDebug  = 0;                     
    $mail->SMTPAuth   = true;                  
    $mail->SMTPSecure = "tls";                 
    $mail->Host       = "smtp.office365.com";      
    $mail->Port       = 578;             
    $mail->AddAddress($email);
    $mail->Username="slietnss@sliet.ac.in";  
    $mail->Password="************";            
    $mail->SetFrom('slietnss@sliet.ac.in','SLIET NSS');
    $mail->AddReplyTo("slietnss@sliet.ac.in","SLIET NSS");
    $mail->Subject    = $subject;
    $mail->MsgHTML($message);
    $mail->Send();
}   }`

亲爱的朋友们,我尝试了很多东西但是无法通过php中的office smtp发送电子邮件

这是我的邮件功能,它显示了一些错误

SMTP -> FROM SERVER:502 Command not implemented SMTP -> ERROR: STARTTLS not accepted from server: 502 Command not implemented SMTP -> FROM SERVER:250 2.0.0 Resetting Language string failed to load: tls

请帮忙。

0 个答案:

没有答案