Re: [PHP3] Getting mail() to activate Autoresponder

From: Date: Tue, 20 Jun 2000 22:40:09 +0000
Subject: Re: [PHP3] Getting mail() to activate Autoresponder
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-2387@lists.php.net to get a copy of this message
In article <E132hPf-0004qq-00@mail3.intekom.com>, ntheron@intekom.co.za ("Neels") wrote: > Hi, > > When I use the web-based script below, I get no response from a > simple autoresponder I set up at my Virtualis hosting account. The > autoresponder works fine when I send it e-mail from my mail client. > > Any ideas? > > <?php > mail("evaluate@marketfriendly.com", > "Evaluaterequest by $name", > "$url, > The email address is $email."); > ?> You don't get a response, but the default email for your Mail Server is getting it. You didn't tell PHP/sendmail where the mail was coming "From", so it's probably coming from "nobody@yourserver.com". You need to add some Mail Headers to forge* the email so it looks like it's coming from where-ever you want the response to go: <?php $email = "ntheron@intekoml.co.za"; mail('evalute@marketfriendly.com', "Evaluate Request by $name", "$url\r\nThe email address is $email.", "From: $email\r\nReply-to: $email\r\n"); ?> More info in the manual about this optional fourth argument. * "forge" in this sense means "fool only the most automatic and brain-dead of software into believing that that's your email address". If you're thinking it's a good way to do some mayhem, think again: Your sendmail is going to insert routing headers to lead right back to you if somebody decides to start digging. This is all covered in the manual and innumerable online code archives. -- Richard Lynch | If this was worth $$$ to you, buy a CD US Customer Support Director | from one of the artists listed here: Zend Technologies USA | http://www.L-I-E.com/artists.htm http://www.zend.com | (this has nothing to do with Zend, duh!)

« previous php.general (#2387) next »