如何防止邮件成为垃圾邮件? [英] How to prevent mail from going to spam?

查看:116
本文介绍了如何防止邮件成为垃圾邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是发送给用户的标头:

Below is header to sent to user:

$to="$mail";
$sub="Thank you!";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type:text/html; charset=iso-8859-1\r\n";
$headers .= 'From: example.com <noreply@example.com>' . "\r\n";
$msg="Dear $nme ,<br/> We received a request to recover your password.<br/> Your Password is $pss .";


$response =@mail($to,$sub,$msg,$headers);

如果我通过diff服务器将其发送到收件箱。
如何防止电子邮件成为垃圾邮件?

If i send it through diff sever it goes to inbox. How can I prevent email going to spam?

推荐答案

$to='example@gmail.com';
$subject='Application Form ';
$message='testing';

 $headers  = 'MIME-Version: 1.0' . "\r\n";
 $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
 $headers .= 'From: admin <admin@gmail.com>' . "\r\n";
 if(mail($to,$subject,$message,$headers))
 {
  echo "Mail Successfully Sent..";
  exit;
 }

对我来说效果很好。您也可以使用SMTP MAIL代替。

It works perfectly to me. You can also use SMTP MAIL instead of this.

这篇关于如何防止邮件成为垃圾邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆