Recently i had to configure one of my email server to relay all email through a third party email service provider name Authsmtp. Authsmtp email server has sender verification policy enabled. so all the email generating from my php application had to use pre defined from address for successful email delivery, my php application was using php mail function to send email. But by default phpmail doesn't change email envelope from address, so though i was using required from address, still the mail server was getting email from apache@localhost. After some search i have found this solution to overwrite email envelope from address.
mail(‘to@somedomain.com’,'subject!’,'body!’,'From: from@yourdomain.com’,'-f from@example.com’);
Hope this will save some ones precious time.
mail(‘to@somedomain.com’,'subject!’,'body!’,'From: from@yourdomain.com’,'-f from@example.com’);
Hope this will save some ones precious time.

0 comments:
Post a Comment