Send test emails with WampServer

What you’ll need:

  • WampServer downloaded and installed (I am using version 1.7.3)
  • Fake Sendmail
  • GoDaddy email account (I tried Gmail and Yahoo email accounts but couldn’t get them working.)

SendmailGo ahead and install WampServer. I just installed mine to the root of the c:\ drive so it makes for easy access (For example, “c:\wamp”).

Next download Fake Sendmail. Fake Sendmail, aka sendmail.exe, is a simple windows console application that emulates sendmail’s “-t” option to deliver emails. Extract the sendmail.zip file and move the folder here: “c:\wamp\sendmail”.

We need the GoDaddy email account because sendmail.exe requires an smtp server to perform the actual delivery of the messages. Now let’s configure some settings in the sendmail.ini file located here: “c:\wamp\sendmail”.

  • line 14 | smtp_server=smtpout.secureserver.net
  • line 18 | smtp_port=80
  • line 38 | auth_username=youremail@goeshere.com
  • line 39 | auth_password=yourpasswordgoeshere

There are a few lines that need to be commented out/uncommented so I am providing a text version of the sendmail.ini file: sendmail.txt. Once your file looks similar to mine, save and close the sendmail.ini file.

Only one step left and that’s to make a change in the php.ini. Access the php.ini using this method below.

Sendmail Illustration 1

Search for sendmail_path and set it to “c:\wamp\sendmail\sendmail.exe –t”.

Sendmail Illustration 2

Save and close the php.ini file.

You must restart WampServer for the changes to the php.ini to take effect.

Having the ability to send test emails is great especially if you frequently work on scripts that require email generation. At least I think so (I’m smiling).

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Google
  • Technorati
  • Digg
  • del.icio.us
  • StumbleUpon
  • Sphinn
  • Facebook
  • Mixx

18 Responses to “Send test emails with WampServer”

  1. [...] Josh Stauffer wrote a tutorial on how to setup WAMP to send email on Windows. This is something that has plague my debugging ability with sending email for a long time. It is something that I’ll be using quite frequently until it becomes ingrained in my head. [...]

  2. One thing to note is to make sure you write out the fill path to the sendmail.exe. I made the mistake of just copying the path and it blew up on me.

  3. Jacob, Glad you were able to get it working.

  4. [...] spent spent some time working on the plugin and was able to test it locally using the tutorial Josh Stauffer wrote. It replaces the ShiftThis SMTP plugin and adds more methods. I have nothing against ShiftThis [...]

  5. Hey Josh, nice tute, just what I am looking for, do you know if this works with phpmailer, I can’t seem to get it working, but not getting any errors.

    Cheers,
    Pat

  6. Pat, I am not sure if this will work with PHPMailer however, the method I outlined is the simplest I have found.

    Try checking the error.log or debug.log inside the sendmail directory for any clues as to why the emails aren’t being sent.

  7. hi josh
    i’m new to this…
    i’ve already try your tute but i got this error :

    Warning: mail() [function.mail]: Failed to connect to mailserver at “localhost” port 25, verify your “SMTP” and “smtp_port” setting in php.ini or use ini_set() in C:\wamp\www\cth\mailsend.php on line 11

    could you please help me?

  8. Khadijah, looks like either you have forgotten to configure your php.ini file or you need to restart WampServer. Read the tute one more time to make sure that you have completed all of the steps. If you need more assistance please let me know.

  9. i need more assistance….i’ve completed all of the steps and already restart wampserver but still got that error..

  10. Warning: mail() [function.mail]: “sendmail_from” not set in php.ini or custom “From:” header missing in f:\program files\wamp\www\contact us.php on line 201

    this error comes i tried so many times

  11. i got the same error, but i found where is the error, generally in php.ini where you setting the path is commented. make sure it is not commented .

  12. hey is the GoDaddy create account free or not? im having a second thought of not creating one because of its future fees… T_T

  13. ive got an error too T_T how can i try emailing myself if ive got this kind of error…

    im new to php, graduate student of Philippines P.U.P. i hope newbies like me are welcome in here

    got an error of:

    Warning: mail() [function.mail]: Failed to connect to mailserver at “localhost” port 25, verify your “SMTP” and “smtp_port” setting in php.ini or use ini_set() in C:\wamp\www\socialized\services.php on line 83

    Please help me…

  14. i hope a newbie like me is welcome in here…
    im a fresh graduate from Philippines and having trouble building a website hehehe just learning PHP along the way…

    but now ive encountered a problem of mailing system…

    Warning: mail() [function.mail]: “sendmail_from” not set in php.ini or custom “From:” header missing in c:\wamp\www\services.php on line 83

    ive followed all the instructions yet ive got an error…

  15. ive been trying to install mail on my wamp for some time now, i came across your tutorial, and it seemed to be spelled out pretty well, im using wamp 2.0. ive made the changes to the php.ini file, ive installed the sendmail into the wamp root, ive configured the wamp to port 80, im using godaddy smtp mail, i have my username@goeshere.com and password according, ive uncommented all the lines identical, i’m not getting any errors, but, i’m not receiving any mail when i fill out my forms, i know the php forms are proper, they work on my “hosting acct” just not sending any mail from my “local host”

    at the bottom of the sendmail.ini theres a field that is uncommented on both of ours. (hostname= ) should that be commented? or filled in? or left blank?

    any help would be appreciated.

    i changed my aol port and my skype port to resolve conflicts, i have router forwarding turned on, i have ports open on my firewall for forwarding, my wamp is in great shape, i just wish it would send my emails somewhere that i could check.

  16. WooHoo

    i guess i made the FATAL mistake of copying and pasting the “c:\wamp\sendmail\sendmail.exe -t” line, as is..

    the quotation makes weren’t correct by doing this i believe.

    (i)should of been in bed 5 hrs ago :sigh:

    thanks for telling me how its done, mostly. and i also went into the “bin” folder, and changed all 3 php.ini files to match the php.ini file that you get when you click on the icon.. i noticed that when you change the php.ini file by clicking the icon, it doesn’t change any of the 3 php.ini files inside of the “wamp\bin\php” folder directory. i changed these before i figured out what my problem was, and i wanted them to all point to the same sendmail_path. do you think it was unneccasary or give me any problems?

    worst case scenario, i can always reinstall wamp and fakemail, and readjust the settings, seeing as how it should only take me 20mins next time instead of 2 sleepless nights. sad? me? i know.

    Thanks again!

  17. RE: PHPMailer

    I got this working with PHPMailer without any problems whatsoever. Make sure and check your C:\wamp\sendmail\error.log file to see what the problems really are.

    Great article, Josh. Functional and to the point.

  18. [...] Configure your installation to send emails using fake sendmail for Windows. [...]

Leave a Reply