简体   繁体   English

邮件使用phpmailer进入垃圾邮件

[英]Mail goes to spam using phpmailer

I have one website in which I used PHPMailer function to send the emails to respective users but all the emails goes to spam or junk folder. 我有一个网站,我在其中使用PHPMailer函数将电子邮件发送给各个用户,但所有电子邮件都发送到垃圾邮件或垃圾文件夹。 I have used below code & include class.phpmailer.php file. 我已经使用下面的代码并包含class.phpmailer.php文件。

======================== ========================

try {
    $mail->AddAddress($to, $toname);
    $mail->SetFrom($from, $fromname);
    $mail->Subject = $subject;
    $mail->Body = $message; 
    $mail->Send();  
    $_SESSION['msg'] = "<div class='alert-success alert text-center'>Request send successfully. Please check your inbox to reset password.</div>";
} catch (phpmailerException $e) {
    $_SESSION['msg']= "<div class='alert-error alert text-center'>".$e->errorMessage()."</div>"; //Pretty error messages from PHPMailer
} catch (Exception $e) {
    $_SESSION['msg']=  "<div class='alert-error alert text-center'>".$e->getMessage()."</div>"; //Boring error messages from anything else!
}

============================ ============================

Please suggest me solution for the same. 请为我建议相同的解决方案。

Thanks 谢谢

If you are talking about GMail it has very good spam classfier and marks it spam on the basis of the source of the mail iefrom where the request was sent for the mail. 如果您谈论的是GMail,则它具有很好的垃圾邮件分类功能,并根据邮件的来源(即发送邮件请求的来源)将其标记为垃圾邮件。 For other mail services try changing the content of the message. 对于其他邮件服务,请尝试更改邮件的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM