Saturday, July 9, 2011

Struggling with PHP SMTP/Email?

Well, as I am diving into the world of PHP (coming from a Microsoft world), I have found setting up the PHP environment to be rather frustrating for myself. With MS, you install Visual Studio, use the built in web server or optionally hook up to the local IIS and you're off for the most part.

However, PHP, in my experience, isn't so ready to go. The installation of extra stuff can be quite a headache, but it is open source/free so you learn to just deal with it I suppose.

So I wanted to get a small program to send email. From my reading, I needed to install PEAR. I found this article to be the most helpful, easy instructions for those on a Windows system. http://www.geeksengine.com/article/install-pear-on-windows.html

I later found I needed to two more installs the Net_SMTP and the Net_Socket, it said Net_SMTP is optional, but I think I needed it.

To install these, I follow the same idea, I download the archive file, then unzip it to a local folder, copy the needed file/folder located inside to the PEAR directory which is inside the PHP install directory.

Extra installs:

http://pear.php.net/package/Net_SMTP/

http://pear.php.net/package/Net_Socket/

For the Net_SMTP, I copied SMTP.php to the NET folder (you many need to create the NET folder)

And then for the Net_Socket, I copied the Socket.php to the NET folder.

I can't quite be sure this are the precise/correct instructions, but I do know I was able to successfully send email!

No comments:

Post a Comment