Re: mail problem

From: Date: Fri, 17 Nov 2000 23:40:03 +0000
Subject: Re: mail problem
Groups: php.general 
Request: Send a blank email to php-general+get-25976@lists.php.net to get a copy of this message
From: Chris Hayes <chayes@antenna.nl> To: Jean-Arthur Silve <jeanarthur@eurovox.fr>,php-general@lists.php.net Subject: Re: Mail problem ! Send reply to: chayes@antenna.nl Date sent: Sat, 18 Nov 2000 00:32:05 +0100 Date sent: Thu, 16 Nov 2000 11:33:14 +0100 Subject: Mail problem ! > In my srcipt I do : > > .... > $bcc="From: me@domain.com\r\nbcc: ".$bcc; > mail("you@domain.com",$SUBJECT,$MESSAGE,$bcc); > ... > > > And I receive this message : > > To: you@domain.com > Subject: subject.... > > bcc: joey@worldnet.fr,a.girou@... etc... > > My message... > > > The problem is that Bcc field appears in the message and the mail is only > sent to "you@domain.com" Hi Jean-Arthur, A long mail as my insight changes every minute... First: i can't understand it's using postfix still. I just know some bits and pieces from experiences with Perl and sendmail and they may help in this case. I'll start with what i saw last: PHP3 manual: mail("nobody@aol.com", "the subject", $message, "From: webmaster@$SERVER_NAME\nReply-To: webmaster@$SERVER_NAME\n X-Mailer: PHP/" . phpversion()); See it just uses '\n' not '\r\n' like you ? What happens if you change that to '\n' ? I mean, it could be that the mailer or PHP sees '\r\n' as a double new line and decides you are ready with the headers and starting the message part?? Then i was thinking: are you sure to use bcc:... and not for instance BCC:... ? Now about sendmail I have had a long lasting argument with that in a Perl script. I just could not get sendmail to accept a call with a 'FROM' sender. Then I finally peeked in someone elses code and now I put the FROM header in the message part. Sendmail accepted that perfectly. <----PERL BIT------> this did not work: $mailprog = '/usr/sbin/sendmail'; open(MAIL,"|$mailprog $Config{'recipient'} -s$Config{'Email_subject'}"); print MAIL "the message"; close (MAIL); [this open/print/close means in short that a long call to the mail program is prepared; in 'open' i start writing the call to the mailprog which is temporarily written to MAIL, then i print the message in several print lines to MAIL and at 'close' the MAIL is actually send to sendmail. Or at least that's my understanding.] this does work: $mailprog = '/usr/sbin/sendmail'; open(MAIL,"|$mailprog $Config{'recipient'} "); print MAIL "Subject: Internet Form Submission\n\n"; print MAIL "the message"; close (MAIL); </--PERL BIT--------> A suggestion to you is not to do $bcc="From: me@domain.com\r\nbcc: ".$bcc; mail("you@domain.com",$SUBJECT,$MESSAGE,$bcc); but to do $bcc="what@ever.nl,or@this.uk"; $MESSAGE="From: me@domain.com\n"."Bcc:".$bcc."\n\n".$message; mail("you@domain.com",$SUBJECT,$MESSAGE); It's just to share my experience, it depends on the mailer whether this will work. Check somewhere how the header should really look, I'm not sure about Bcc:.... is the correct grammar! Hope this helps, gotta sleep now, gotta save the climate tomorrow in The Hague :-). good night, Chris -------------------------------------------------------------------- -- C.Hayes Droevendaal 35 6708 PB Wageningen the Netherlands -- --------------------------------------------------------------------

« previous php.general (#25976) next »