[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

PHP mail "unable to relay" error

Posted on 2010-09-20
4
Medium Priority
?
736 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 1000 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 84

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 1000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses
Course of the Month20 days, 14 hours left to enroll

810 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