Page 1 of 1

Problems using mail() function

Posted: Thu Mar 18, 2004 9:33 am
by mjseaden
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

Re: Problems using mail() function

Posted: Thu Mar 18, 2004 9:40 am
by TheBentinel.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
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".

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