Re: Re: mail function

From: Date: Mon, 21 Jul 2003 09:51:45 +0000
Subject: Re: Re: mail function
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-156030@lists.php.net to get a copy of this message
> >Does mail() return true? I mean, do you get printed "U redu je"? If so, your > >email should've been sent by PHP. > > > >You are really missing a bunch of headers. I'm not sure if this is your > >problem, but I think it's not a bad idea to include more headers, also > >because more and more ISP's add some kind of spamfilter which might drop > >your email. So maybe by adding more headers, you can solve this. > > > >I use this: > > > >$headers = "MIME-Version: 1.0\r\n"; > >$headers .= "Content-Type: text/plain; charset=iso-8859-1\r\n"; > >$headers .= "X-Priority: 3\r\n"; > >$headers .= "X-MSMail-Priority: Normal\r\n"; > >$headers .= "X-Mailer: PHP/".phpversion()."\r\n"; > >$headers .= "From: Name <You@Domain.com>\r\n"; > > > >$body = "Whatever is in your email"; > > > >$to = "Name <Where-ever@this-needs-to-go.com>"; > >$check_mail = mail($to, "Subject", $body, $headers); > > When PHP sends an email to a non existing email address such as > You@Domain.com, the warning mail you normally get returned often does not > arrive in your mailbox. Therefore I add two additional headers: > > ."Reply-To: me@domain.nl\r\n" > ."Return-path: <me@domain.nl\r\n" > > and now I do get the notification mail when mail bounces. That's funny, because I always had that problem, too. By adding Reply-To and Return-path, it did not fix my problem. Boucing emails never got back to me. Return-path was overwritten by my hostingserver to 'nobody@...' and Reply-To was apparently ignored by the server bouncing the email. Do you think servers differ in this a lot? -- [Win2000 | Apache/1.3.23] [PHP/4.2.3 | MySQL/3.23.53] Ivo Fokkema PHP & MySQL programmer Leiden University Medical Centre Netherlands

« previous php.general (#156030) next »