SMTP server response: 550 5.7.1 Unable to relay - *A Solution*
I just spent the last 3 hours chasing my tail trying to figure out a install problem I was having with Drupal:
Symptom
When logging into Drupal for the VERY FIRST TIME (read, fresh install), the standard e-mail fails with the following error message:
"SMTP server response: 550 5.7.1 Unable to relay.."
This causes drupal to provide a temporary password within the same screen (rather than mailing it out) - when you try to navigate away from the screen there are missing menus (specifically the entire admin tree). Anyway, to solve the problem here is what I did to enable SMTP Relaying on my test machine:
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)
At this point it should work, but just to be extra sure, create a php page called SMTPtest.php and drop in the following code:
----------------
<?
$to = "youremailaddress@domian.com";
$subject = "test from localhost";
$msg = "I completely understand SMTP servers now!";
$headers = "From: localhost@localhost.com\nReply-To: localhost@localhost.com";
$config = "-stfu@noob.com";
mail("$to", "$subject", "$msg", "$headers", "$config");
echo "finished!";
?>
----------------
Once you have this file, drop it in your drupal root directory, then hit the page with a browser. If you see a "finished!" message, then check your inbox and you should have a test message sent from localhost. If you see anything resembling the relay message again, double-check your steps 1-8 (as described above) and try again.
Good luck!

Worked. . .once.
I tried this solution and I was able to have the script send me one email, but the first test user failed to recieve the registration confirmation email. Things seemed to revert, though the settings had not changed.
One big difference is that my server has Exchange on it, in addition to IIS running, and the relay options are in the Exchange System Manager, not in IIS Manager. Otherwise, they should work the same, and they certainly look the same.
I'm so close to having everything work great. What gives?
For what it's worth, the very first user received the email just fine, it was simply all other users after that who registered through the website.
worked for me
Thanks for the tip. I was having the same issue even though I had the server's actual IP in the Relay restrictions. I added the localhost IP as you suggested and mail sent just fine.
I take it back. It worked for sending me a forgot password email, but not for new registrations.
thanks
thank you calderson for the tip (and being explicit about it). It is nice to have people like you in this world.
Yes!
calderson....thank you, thank you, thank you and....THANK YOU!
THANXS
THANK YOU FOR THE TIP, IS A REALLY GOOD WAY TO MAKE A BIG KNOWLEDGE COMUNITY. FOR ME WAS VERY USEFUL
!?!?!?
code is still not working...
i hav done all this + changed the three lines of php.ini
i m confused about where to put this new php test page .. in wwwroot folder or mailroot.. ???
i tried both .. n it didnt work:(
$unila
LOL......I like your sample
LOL......I like your sample email PHP code.....very nice ;) I had a brain fart and pulled this rookie maneuver too when setting up my relay as well.
thanks a lot.. fakhre
thanks a lot..
fakhre
Relay Error
hi calderson,
Your information really helped me a lot.
Cheers and Thanks,
Paul Mwiu
SMTP server response: 550 5.7.1 Unable to relay - A Solution ?
I am using WAMP and Windows Vista and having the same problem. Wonder if anyone has any ideas on how I may be able to fix it...already spent many hours on it....thanks!!!!
chander