We have a system that needs to send automated emails. But we were having a problems where we were not getting bounce emails from invalid email addresses.
After half a day of digging it turns out the problem was that the Return-Path header was being set to the user that the web server runs as. Which was a non-existent email address.
To set the Return-Path in PHP on a unix environment use:
mail('email@example.com', 'the subject', 'the message', null, '-firstname.lastname@example.org');
In windows envioronment use:
For more information see: http://www.php.net/manual/en/function.mail.php
Filed under: Programming |