如何避免从邮件发送邮件()被标记为垃圾邮件? [英] How to avoid my mails sent from PHP mail() being marked as spam?

查看:410
本文介绍了如何避免从邮件发送邮件()被标记为垃圾邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下方式发送注册电子邮件:

  $ subject ='subject is here'; 
$ message_raw ='电子邮件文本';

$ message = base64_encode($ message_raw);

$ headers ='MIME-Version:1.0'。 \r\\\
;
$ headers。='Content-type:text / plain; charset = UTF-8'。 \r\\\
;
$ headers。='Content-Transfer-Encoding:base64'。 \r\\\
;
$ headers。='From:papa.sk< register@papa.sk>'。 \r\\\
;

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

对于某些人来说,电子邮件被放入垃圾邮件文件夹(在gmail中) p>

在/etc/postfix/main.cf我有这个:

  myorigin = / etc / mailname 
smtpd_banner = papa1.vps.websupport.sk ESMTP

解决方案

php mail()功能与您的电子邮件被标记为垃圾邮件无关。



另一端的电子邮件被标记为垃圾邮件。你不能用 mail()来影响这个过程,因为它是另一端。



可以有千为什么电子邮件被标记为垃圾邮件的原因,只要您不知道您的电子邮件被标记为垃圾邮件的具体原因,您就不能做任何反对。



有一个整个行业生活在这个btw。


I'm using the following to send registration e-mails:

$subject = 'subject is here';
$message_raw = 'e-mail text';

$message = base64_encode($message_raw);

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/plain; charset=UTF-8' . "\r\n";
$headers .= 'Content-Transfer-Encoding: base64' . "\r\n";
$headers .= 'From: papa.sk <register@papa.sk>' . "\r\n";

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

For some people the e-mails are put into the spam folder (in gmail too).

In /etc/postfix/main.cf I have this:

myorigin = /etc/mailname
smtpd_banner = papa1.vps.websupport.sk ESMTP

Not sure whether I should change the above.

解决方案

The php mail() function has nothing to-do with your emails being marked as spam.

That an email is being marked as spam happens on the other end. You can not influence the process much with mail() - as it's the other end.

There can be thousand of reasons why an email is being marked as spam, and as long as you don't know the concrete reason why your email is being marked as spam, you can do nothing against that.

There is a whole industry which makes a living of that btw.

这篇关于如何避免从邮件发送邮件()被标记为垃圾邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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