简体   繁体   English

如何发送通知电子邮件给用户,避免被phpgmailer标记为垃圾邮件?

[英]How to sent notification email to user avoiding to be marked as SPAM by phpgmailer?

I`m using PHPGmailer to sent some important notification for registered user. 我正在使用PHPGmailer向注册用户发送一些重要通知。 The email is Google App powered. 该电子邮件由Google App驱动。

here is my configuration for sent email function with PHPGMailer class: 这是我使用PHPGMailer类的已发送电子邮件功能的配置:

function send_mail($to, $subject, $content)
{
    $mail = new PHPGMailer();
    $mail->Username = 'info@domain.com'; 
    $mail->Password = 'xxxxxx';
    $mail->From = 'info@domain.com'; 
    $mail->FromName = 'domain';
    $mail->Subject = $subject;
    $mail->CharSet = 'UTF-8';
    $mail->AddAddress($to);
    $mail->IsHTML(true);
    $mail->Body = $content;
    $mail->Send();  
}

Is it good enough to sent notification and prevent to be marked as spam? 发送通知并防止被标记为垃圾邮件是否足够? Or add some more additional configuration and settings? 还是添加更多其他配置和设置?

A big part of preventing emails from being marked as spam is your mail server setup. 防止电子邮件被标记为垃圾邮件的很大一部分是您的邮件服务器设置。

A google search for 'prevent emails from being marked as spam' returns a bunch of info. 谷歌搜索“防止电子邮件被标记为垃圾邮件”会返回一堆信息。

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

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