Re: Sendmail "return-path" from my virtual webhost

From: Date: Mon, 29 Jul 2002 18:35:30 +0000
Subject: Re: Sendmail "return-path" from my virtual webhost
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-110222@lists.php.net to get a copy of this message
> Emails sent from my php scripts, using sendmail, all have a goofy > "return-path" variable in the header. > > Is there a way I can correct this, or does it require a change to the > sendmail config file that I can't get to? You should be able to use the fifth parameter ("additional parameters") that was added in PHP 4.0.5 to properly set the envelope-sender, which will cause the 'Return-Path' header to be set properly. Quick example: <? $to = 'You <you@yourdomain.com>'; $from = 'me@mydomain.com'; $subject = 'hey!'; $message = 'This is the message.'; mail($to, $subject, $message, "From: $from", "-f$from"); ?> Note that this doesn't do error checking on the status of the mail() command -- it's just a quick example. There also may be sendmail config things that prevent you from setting the Return-Path in this manner; that's out of my area of expertise, so if the above doesn't work, I'm not much more help... Joel -- [ joel boonstra | jboonstra@gospelcom.net ]

« previous php.general (#110222) next »