发件人,php sendmail

时间:2013-04-01 03:06:24

标签: php gmail sendmail

我使用sendmail和PHP进行设置,sendmail通过启用了SSL和SPF的Gmail / Google Apps帐户发送电子邮件。

电子邮件的发送和运行没有任何问题。

目前唯一的限制是所有外发电子邮件都是从sendmail.ini中设置的Gmail帐户发送的,FROM:值会被忽略。

有没有让脚本在指定时使用自定义FROM并将Gmail用于未指定的?

2 个答案:

答案 0 :(得分:0)

希望这可能会有所帮助..

// Please specify your Mail Server - Example: mail.example.com.
ini_set("SMTP","mail.example.com");

// Please specify an SMTP Number 25 and 8889 are valid SMTP Ports.
ini_set("smtp_port","25");

// Please specify the return address to use
ini_set('sendmail_from', 'example@YourDomain.com');

或了解更多信息..

进入此链接here

答案 1 :(得分:0)

我为此搜索了很多,但实际上这似乎不是问题。 问题是我必须添加我想用作发件人的任何电子邮件(从帐户发送)到sendmail.ini中配置的主Gmail帐户,之后我才能从允许的地址发送。

但是,当我们在网站上有公开表格并且有人向我们发送电子邮件时,问题就会产生,他们的地址也不会显示为发件人电子邮件。解决方案是使用Reply-To标头标签。由于回复地址无法在Gmail中正确显示,因此Gmail仍然存在此限制。测试Web和&移动/ Android版本。

但它在MS Outlook和Thunderbird等其他电子邮件客户端中运行良好。