Forum Moderators: coopster

Message Too Old, No Replies

PHP Mail Problem

Error messages when containing a hyphen ( - )

         

burcot

5:55 pm on Mar 16, 2006 (gmt 0)

10+ Year Member



Hi

I thought my php mailing script was working absolutely fine but encountered a bug by chance.

Whenever the recipient's email address includes a hyphen ( - ), I get the following error message...

Warning: mail() [function.mail]: SMTP server response: 550 Invalid recipient:

I should stress that this only seems to occur when the hyphen is in the URL portion of the address, i.e example@perfect-example.com

The current code works along the lines of...

mail ($_POST['email'], 'Email subject is here', $body, $headers);

Does anybody have any suggestions please?

Cheers

coopster

2:22 pm on Mar 17, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



A hyphen should be acceptable. I would dump that variable to the browser to see what it contains. I notice it is POSTed information, so perhaps your installation has slashes or something added that is causing issues.