Solved

PHP mail "unable to relay" error

Posted on 2010-09-20
4
696 Views
Last Modified: 2012-05-10
Hi there. I'm building email functionality on a PHP contact form processor. It sends to and from a set email address on the same domain as the server. I have tested this successfully on my own development server, but when the code is tested on the client's web site, I get the following error message:

"Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for username@domain.com in C:\Program Files (x86)\EasyPHP-5.3.3\www\contact\feedback.php on line 221"

Note: i removed the email address and put 'username@domain.com' in its place. Online, I'm using a valid email address.

I don't have access to the client's web server. He deploys the code himself. Are there any instructions I could briefly point my client to in order for him to properly configure his mail server?

Thanks!
0
Comment
Question by:thtate
  • 2
4 Comments
 
LVL 4

Accepted Solution

by:
rstjean earned 250 total points
ID: 33721164
the odds are that the client's mail server doesn't allow the website to relay email.  You can get the ISP to put in a rule to relay, or if the hosting machine is a windows server then you will need to configure IIS as follows.

1) Go to: start > settings > control panel > Administrative Tools > Internet Information Services
2) Expand the " (local computer)" node
3) Right click on your SMTP server > go to "Properties"
4) Click "Access" tab
5) Under Relay Restrictions, click the "Relay" button
6) Click "Add"
7) Select "Single Computer" and enter IP address 127.0.0.1
8) Hit OK, OK, OK (until the properties dialog is closed)
0
 
LVL 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 250 total points
ID: 33721199
Can he send email on that server with the email address you're using?  Did you try adding the "-f" fourth parameter in the mail() statement?  That's a Windows error statement.  What SMTP server did he install?
0
 

Author Comment

by:thtate
ID: 33725001
Turns out that the client needed to change some settings in his PHP.INI file.

Now the relay error is no more.

Thank you both for the help!
0
 

Author Closing Comment

by:thtate
ID: 33859806
Thanks!
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now