Page 1 of 1

emails formated incorrectly

Posted: Tue Mar 06, 2007 10:25 am
by PeterK2003
i keep getting this error(from apache):
[Tue Mar 06 04:09:31 2007] [error] [client 192.168.0.2] PHP Warning: mail() [<a href='function.mail'>function.mail</a>]: SMTP server response: 550 Sender address must be specified. in D:\\ftp\\Peter.krum.name\\blog\\serendipity\\include\\functions.inc.php on line 526, referer: http://peter.krum.name/blog/serendipity ... tatus.html

Because it is formating the mail from string like this(from mail server):

"SMTPD" 2276 58122 "2007-03-06 04:09:27.661" "192.168.0.253" "RECEIVED: MAIL FROM:<"test" <blog@krum.name>>"

Any suggestions?

Thanks,

Peter

Posted: Tue Mar 06, 2007 10:33 am
by PeterK2003
Actually i just fixed it. I changed this line:

$maildata['headers'][] = 'From: "'. $maildata['fromName'] .'" <'. $maildata['blogMail'] .'>';

to:

$maildata['headers'][] = 'From:<'. $maildata['blogMail'] .'>';

in functions.inc.php

hope that helps someone!


~Peter

Posted: Tue Mar 06, 2007 10:50 am
by garvinhicking
Hi!

Usually that From: "Name" <mail> notation is right, but I wonder why your SMTP server transfroms it to From: <"Name" <mail>> -- the additional "<>" there mix up the thing.

So even though I'm happy you found a fix, that fix would actually reduce the functionality in most working SMTP servers, as the name of the poster is no longer contained in the sender email...

Thanks for sharing!

Best regards,
Garvin

Posted: Tue Mar 06, 2007 11:07 am
by PeterK2003
My mail server(hmail server) and gmail's server both did the same thing and I have other php apps that send mail fine so I don't think that it is an issue with the server but I can't prove that.

Even after i changed that there is still an extra set of <> that I don't know where they came from:

"SMTPD" 2276 58189 "2007-03-06 04:29:47.176" "192.168.0.253" "RECEIVED: MAIL FROM:<<blog@krum.name>>"

But it at least accepts the mail now.

Thanks for the reply,

~Peter