TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   My mail server is making this noise: AAArrruuuuggggha. (http://www.talkphp.com/general/2702-my-mail-server-making-noise-aaarrruuuuggggha.html)

delayedinsanity 04-24-2008 10:01 PM

My mail server is making this noise: AAArrruuuuggggha.
 
Seriously. Is this something I'm doing wrong, or is my SMTP server just being a jackass?


Warning: mail() [function.mail]: SMTP server response: 550 5.5.0 <name <name@domain.com>> '@' or '.' expected after 'name' in /htdocs-ke/bin/lib/mail.class.php on line 23


Works fine when I use nothing but an email as the From: or To: header, but I can't use "Name <email@address.com>" for whatever reason.

PHP Code:

$szTo $szUsername " <" $szEmail ">";

return 
mail($szTo$szSubject$szBody$szFrom); 

No go. Looks fine to me and according to the PHP manual for the mail function, it uses that convention too. *looks at Salathe*
-m

Wildhoney 04-25-2008 01:51 PM

I think you're best off using a normal email address in the first argument. And then for the headers using an array which you can implode by new line, as the header argument accepts a string, I believe.

php Code:
$aHeader = array
{
    'to:' => 'Adam <adam@example.org>',
    'from:' => 'Bob <bob@example.org'
}


All times are GMT. The time now is 08:18 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0