开发者

php mail function cannot send to name.sirname@doman.com ??i

I'm having trouble when sending emails thorough the mail() function.

开发者_如何学JAVAI have a script that works perfectly fine for an email address like name@domain.com but when the first part of the email is something with a dot like name.surname@domain.com it doesn't work and returns this error :

Warning: mail() [function.mail ]: SMTP server response: 554 : Recipient address rejected: Relay access denied in confirmed.php on line 119

I am using real email address but have changed it in the above example.

Any thoughts - I'm not a php master but surely there is an easy way to send emails to address with a 2 part first section??

Thanks in advance Ali


It is not PHP's fault. It is your SMTP-server. Check mail log i.e. /var/log/mail.log and see if it puts out anything. My best guess is that your relaying is missconfigured.


If the code below fails with this error, then DeeD is partially correct - but it's not relaying which is broken - the address re-writing rules are completely ^&*(ed up.

<php 
 mail('name.surname@domain.com','hello','test');
?>

Also try:

However this would be a phenomonally stupid error on the part of the person who set up the MTA. I susepct its much more likely that code elsewhere may be modifying the address before the call to mail(...) or that your analysis is incomplete. If this is the case, then neither of the tests above will return the original error - instrument your code to find out where the address is being changed.

Alternatively, if the MTA really doesn't like a . in the name - go buy a cattle prod for the person who configured it.

C.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜