nadeemshafi9 Posted February 10, 2009 Share Posted February 10, 2009 Hello I am trying to set extra headers for the email in order to set a return-path for bounces, i am using pear mail mime and its working wonderfully but i cant seem to set this header, when i look at the code of the email when it arrives the return-path header is at default, myname@mymachine.com which i would like to change. my code follows the instruction http://pear.php.net/package/Mail_Mime/docs/latest/Mail_Mime/Mail_mime.html#methodheaders array &headers( [array $xtra_headers = null], [bool $overwrite = false]) Parameters: array $xtra_headers — Assoc array with any extra headers. Optional. bool $overwrite — Overwrite already existing headers. <?php // Body $body = $this_mail_mime->get(); // Extra Headers $extra_headers['return-path'] = 'nadeem.shafi@mycomp.com'; // Headers $headers = $this_mail_mime->headers($extra_headers, true); ?> Thanks Quote Link to comment Share on other sites More sharing options...
printf Posted February 10, 2009 Share Posted February 10, 2009 Something like... <?php // include pear mail $return_email = 'bounce@domain.com'; $mail = Mail::factory ( 'mail', array( 'Return-Path' => '-f ' . $return_email ) ); // the rest of your mail junk here ?> Quote Link to comment Share on other sites More sharing options...
nadeemshafi9 Posted February 10, 2009 Author Share Posted February 10, 2009 grate thanks a caught all the bounce backs wow, can you add two emails to it im gonna try, thanks again printf Quote Link to comment Share on other sites More sharing options...
nadeemshafi9 Posted February 10, 2009 Author Share Posted February 10, 2009 now i have to use imap or something to read the mail box and generate a report Quote Link to comment Share on other sites More sharing options...
nadeemshafi9 Posted February 10, 2009 Author Share Posted February 10, 2009 im thinking an ajaxian read of the mailbox that will auto update every second as the bounces come in Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.