开发者

Removing the 'Mailed-by` header from outgoing emails

I am sending emails using PHP Pear class, when I see mails in gmail, it has an Mailed-by header, I know it can be removed by using -f in php mail function, but how can I remove it in 开发者_如何学CPear send.


try this.

$headers["Return-Path"] = "info@yourdomain.com";


The Mail Pear library is actually just a php file on your system. I highly doubt there is a programmatic way to do what you want, but if you can't find it in the PEAR documentation you can just examine the Mail.php file yourself.

Try using the locate command on your system to find the Mail.php file. It should be in /usr/local/lib or /usr/local/php/lib or something similar. Probably under a subdirectory called PEAR.

Once you find it and if you're comfortable with this, you can edit the source file to do whatever you want (i.e. comment out the line that adds that header). Note this will affect all PHP scripts on this system and will have to be re-added if you update PEAR.


Looking at the PEAR mail manual page, it seems like you have to specify all headers explicitly. Are you sure you're not setting $headers['MailedBy'] elsewhere in your application? You may also want to look at this PEAR manual (wiki) page for a minimal working example of the package.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜