Xurion Posted October 27, 2006 Share Posted October 27, 2006 Whilst testing a script i supplied my own email address in the code so the mail command I was using would show me it was working when I received an email. Once the code was complete, the address was changed to another and for some reason the following error appears:Warning: mail(): SMTP server response: 554 <[email protected]>: Recipient address rejected: Relay access denied in bla bla.. on line 14Seems to work if I change it back to my address.Any suggestions would be great. Link to comment https://forums.phpfreaks.com/topic/25283-error-in-sending-an-email-with-the-mail-command/ Share on other sites More sharing options...
lonewolf277 Posted October 27, 2006 Share Posted October 27, 2006 Hmmm... interesting problem. :)I'm assuming you can send mail to the address from something like GMail or Thunderbird? What headers are you using? Are you hard-coding the e-mail address in, or are you getting it from somewhere else like a database? Link to comment https://forums.phpfreaks.com/topic/25283-error-in-sending-an-email-with-the-mail-command/#findComment-115287 Share on other sites More sharing options...
vamsee Posted October 27, 2006 Share Posted October 27, 2006 Dude I had the same problem before. You have to contact your hosting compnay regarding this error. It has nothing to do with your code. Tell them you face this problem and then they will rectify it. Link to comment https://forums.phpfreaks.com/topic/25283-error-in-sending-an-email-with-the-mail-command/#findComment-115288 Share on other sites More sharing options...
Xurion Posted October 27, 2006 Author Share Posted October 27, 2006 [quote author=lonewolf277 link=topic=112907.msg458486#msg458486 date=1161941428]Hmmm... interesting problem. :)I'm assuming you can send mail to the address from something like GMail or Thunderbird? What headers are you using? Are you hard-coding the e-mail address in, or are you getting it from somewhere else like a database?[/quote]The test address i used (my personal one) was [email protected], and the client's email was another hotmail.com address (if I have to give this also I will)here is my code:[code]<?phpini_set("sendmail_from", "[email protected]");$mailfrom = "[email protected]";$mailto = "[email protected]";$mailtext .= 'This is the body text';$headers = 'From: '.$mailfrom.'Reply-to: '.$mailfrom.'Return-path: '.$mailfrom.'Content-type: text/html';mail($mailto, 'Notification', $mailtext, $headers);echo 'complete';?>[/code]As you can see I am hard coding pretty much everything. When i change the address it does not work and gives me the error i supplied in the OP.Thx so far! Link to comment https://forums.phpfreaks.com/topic/25283-error-in-sending-an-email-with-the-mail-command/#findComment-115294 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.