简体   繁体   中英

email sends to spam of gmail account

I have set automatically to send email to users from my website. but this email will place to spam of users with gmail accounts.However it is working fine with yahoo or hotmail accounts. How should I solve this?

$to = "$Email";
$subject = "Greeting";
$message = 'message here';
$from = "sender@example.com";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$headers .= "From: sender@example.com" . "\r\n" .
  "Reply-To: sender@example.com" . "\r\n";            

                mail($to,$subject,$message,$headers);

Since your headers appear to be correct, it's probably keying on something within the message. One of the things that SpamAssassin (no idea if this is what Gmail uses) keys on is a very short message like the above containing a hyperlink or graphic, so you may benefit by actually making your message a little longer. One of the ways to find out is to send it to your own gmail account and when it appears in your spam folder, examine the headers there for any added spam information. It may contain clues as to what spam engine Gmail is using or what rules your message is breaking.

Please have a look here:

Spam sent to Contacts - Message Delivery

Hope this helps!

它应该是smtp配置电子邮件,网站信息的电子邮件ID应该不同。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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