Dear All,
I have looked on Google to try and find an answer to this seemingly basic problem, however no joy.
I'm trying to use the PHP mail() function to send a single simple e-mail to a mail account. However, when I try and execute the mail() function I get the following error message:
Warning: mail(): SMTP server response: 554 <mail@mail.com>: Recipient address rejected: Relay access denied in \\XXXXXX\domains\s\mydomain.biz\user\htdocs\index.php on line XXXX
Obviously it's an SMTP problem, however I am not knowledgable of either the cause or the underlying issues.
Can anyone explain what is going on?
Many thanks again
Mark
Problems using mail() function
Moderator: General Moderators
-
TheBentinel.com
- Forum Contributor
- Posts: 282
- Joined: Wed Mar 10, 2004 1:52 pm
- Location: Columbus, Ohio
Re: Problems using mail() function
The error means that the SMTP server is unwilling to send mail to other domains. If your server is "myserver.com" then it would probably be willing to accept mail for "dave@myserver.com", but not for "dave@someserver.com".mjseaden wrote: Warning: mail(): SMTP server response: 554 <mail@mail.com>: Recipient address rejected: Relay access denied in \\XXXXXX\domains\s\mydomain.biz\user\htdocs\index.php on line XXXX
You need to talk to your hosting provider about allowing you to send mail. You won't be able to fix it from PHP.
You could, though, use sockets to connect to your own SMTP server. There's a note about that in the manual page for mail, I think:
http://www.php.net/mail