Thursday, January 03, 2008

PHP Tip: Instant SMTP Server

I needed to send mail from my local PHP server, but didn't have an SMTP server that would be willing to relay messages for me. On a Linux box this isn't usually a problem, as you can always run sendmail (or qmail or postfix) locally, and just have it deliver your mail directly. But I'm on Windows, so things are trickier.

A quick Google search found me: Free SMTP. It does pretty much what it claims to. After installing, you run it manually from the Start Menu. It then listens on port 25 and will gladly deliver any mail you hand to it.

I tweaked my php.ini to say:

SMTP = localhost
smtp_port = 25

And I was good to go.

Now, I wouldn't recommend using this approach for anything other than testing (works great with mailinator, by the way). Also, I've added it to my thumb drive, as it seems like it might be a handy tool to have around in a pinch.

Oh, and in this case the free in Free SMTP does indeed mean no-charge. So download it and give it a try.

No comments:

Post a Comment