itrinium Posted July 29, 2009 Share Posted July 29, 2009 Hi all Sorry that my first post is a question, but still on a learning curve! I have moved a site from Cpanel on Linux to a dedicated Windows 2003 server and everything works fine except I cannot figure out what the site uses to send email. When I try to get the site to send an email I get Warning: mail() [function.mail]: SMTP server response: 501 5.5.4 Invalid Address in D:\Website\classes\Htmlmail.php on line 287 I have attached the htmlmail.php file to see if anyone can point me in the right direction. Any help greatly appreciated Thanks Mark [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/168003-can-anyone-figure-out-what-this-is-using/ Share on other sites More sharing options...
Maq Posted July 29, 2009 Share Posted July 29, 2009 The same error has been reported in the manual. Please read this entry: http://us.php.net/manual/en/function.mail.php#77012 It has to do with the way you're providing the address. It's a platform issue. Quote Link to comment https://forums.phpfreaks.com/topic/168003-can-anyone-figure-out-what-this-is-using/#findComment-886105 Share on other sites More sharing options...
itrinium Posted July 29, 2009 Author Share Posted July 29, 2009 Hi Maq Thanks for your reply, looks like some bedtime reading! The line of code that seems to cause the problem is: mail($to, $subject, $this->mime, 'From: '.$from."\n".implode("\n", $this->headers)."\n".implode("\n", $xtra_headers)); Is then anything that can be deemed from this? Thanks Mark Quote Link to comment https://forums.phpfreaks.com/topic/168003-can-anyone-figure-out-what-this-is-using/#findComment-886114 Share on other sites More sharing options...
Maq Posted July 29, 2009 Share Posted July 29, 2009 Echo the contents of '$to' and post the output. Quote Link to comment https://forums.phpfreaks.com/topic/168003-can-anyone-figure-out-what-this-is-using/#findComment-886116 Share on other sites More sharing options...
PFMaBiSmAd Posted July 29, 2009 Share Posted July 29, 2009 Multiple extra headers should be separated with a CRLF (\r\n). Quote Link to comment https://forums.phpfreaks.com/topic/168003-can-anyone-figure-out-what-this-is-using/#findComment-886118 Share on other sites More sharing options...
itrinium Posted July 29, 2009 Author Share Posted July 29, 2009 Hi maq Thanks for your time when echoing '$to' as requested, no error appears Quote Link to comment https://forums.phpfreaks.com/topic/168003-can-anyone-figure-out-what-this-is-using/#findComment-886128 Share on other sites More sharing options...
Maq Posted July 29, 2009 Share Posted July 29, 2009 Hi maq Thanks for your time when echoing '$to' as requested, no error appears That's not was I was implying. I want to see the output. Like the example I provided, the error you're receiving could be caused by the way you're passing the contact information to mail(). Also take a look at PFM's suggestion as mine is just a likely guess. Quote Link to comment https://forums.phpfreaks.com/topic/168003-can-anyone-figure-out-what-this-is-using/#findComment-886131 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.