Solved

PHP mail "unable to relay" error

Posted on 2010-09-20
4
702 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 83

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

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

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

Suggested Solutions

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

808 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