我已经设置了 sendmail 和 PHP,sendmail 通过启用 SSL 和 SPF 的 Gmail/Google Apps 帐户发送电子邮件。
电子邮件已交付并正常工作。
到目前为止,唯一的限制是所有外发电子邮件都是从 sendmail.ini 中设置的 Gmail 帐户发送的,FROM: 值被忽略。
无论如何让脚本在指定时使用自定义 FROM 并为未指定的脚本使用 Gmail?
希望这可能会有所帮助..
// 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');
或了解更多信息..
在此链接中进入。
I have Googled a lot for this but it seems like it's not a problem actually. The thing is I have to add whatever email I want to use as Sender (send from account) to the main Gmail account configured within sendmail.ini after that I was able to send from the allowed addresses.
However the problems accrues when we have a public form on the site and some one sends us an email, their address won't be shown as sender email either. the solution for this is to use the Reply-To header tag. Gmail still has limitations regarding this as the Reply-To address won't show correctly within Gmail. Tested both Web & Mobile/Android versions.
But it works fine within other email clients like MS Outlook and Thunderbird.