Page 1 of 1

Odd Mail Problem....

Posted: Tue Jan 13, 2004 4:58 pm
by hawleyjr
Hello, I have created a php mail ap. The ap its self works fine however, as soon as an e-mail goes out to an account whose domain has a hyphen in it. I get an error. ( myname@my-site.com ) would produce an error for me. Although my-site.com is a legitimate site.

I've searched the forums and came up dry. Any suggestions?

Posted: Tue Jan 13, 2004 5:07 pm
by uberpolak
What's the error message say? That, along with some code, if possible, could make this a much easier problem to solve.

Posted: Tue Jan 13, 2004 5:12 pm
by hawleyjr
The error I am getting is as follows:

myname@my-site.com/www913/web/ifgwo1/dead.letter... Saved message in /www913/web/ifgwo1/dead.letter

the mail code is basic php mail code:

$headers = "From: $from\r\n";

$success = mail($to, $subject, $message, $headers);

Posted: Tue Jan 13, 2004 5:19 pm
by uberpolak
Hmm, perhaps something in your SMTP server's setup doesn't like the hyphens for some reason, can you regularly send mail through it to an address with a hyphen, that is, with an email app or a different script?

Problem Solved...

Posted: Tue Jan 13, 2004 5:57 pm
by hawleyjr
My problem was not at my server but the php code.

I'll explain...

The error had nothing to do with a hyphen "-"

The problem was the customer I was dealing with gave me the wrong domain to their email.

When you send an email to a person say bill@devnetwork.net the mail goes to devnetwork.net a legitimate domain. at which point the devnetwork.net server sends the mail to bill. If there isn't an account at devnetwork listed as bill then the devnetwork.net server sends a un-deliverable to the sender.

However, If you were to send an email to a fictitious domain such as bill@myfakedomain22222444.com the php code does not know what to do with the e-mail. Hence the error mssg I was getting.

I'm curious to know if this is synonymous the the mail server I am using or a standard. Try it if you want and let me know.

Thanks uberpolak for the help.

-James

Posted: Tue Jan 13, 2004 7:00 pm
by Gen-ik
Like uberpolak said it sounds like it's got something to do with your server and not PHP.

I've just tried sending a fake email from PHP through my server and it works fine... the email is just lost in the 'void' and no error messages are spat out by PHP.