On 9/26/06, Richard Lynch <ceo@xxxxxxxxx> wrote:
On Tue, September 26, 2006 11:09 am, php@xxxxxxxxxxxx wrote: > I have an issue with sending email via PHP which may be a > configuration problem with either PHP, Apache, or possibly a Sendmail, > but I don't know which yet. I figured I'd start here first. > > Here's the situation. I have several webpages that send email to > users for various reasons. We have our webserver, an intranet > webserver, configured to connect to our smtp server which sits on a > different box. The script looks like this: > > <?PHP > $from = "webmaster@xxxxxxxxxxxx"; > $to = "someemail@xxxxxxxxxxxx"; > $subject = "Test"; > $msg = "This is a test from my site\n\nTimestamp: " . date("r"); > $headers = "From:$from\r\n"; Add a space after the ':' to be kosher.
::cough::rfc compliant::cough::)
Add a Reply-To: Add an Errors-to: (I think?)
Yeah these can help in finding out the problem, the Errors-To: header is usually used when the original message can't be delivered, if the server handling the message supports it will send to that header instead of the envelope addressee. The Reply-To, is more for the client software, iirc.
> if(!mail($to,$subject,$msg,$headers)) { die("Unable to send"); } *IF* you are using PHP5 (?) and *IF* your security settings allow it, the optional fifth argument will let you specify the "real" sender of the message, which the responder may or may not be using to bounce to.
php4 allows the '5th' param as well, but the safe_mode paramater does affect if you are able to use this. Curt. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php