by newbie| for newbies

Main menu

Post navigation

How to use Mercury Mail in XAMPP

When you try to use the mail() PHP function in your local computer, you get this message:

Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\xampp\htdocs\test.php on line 14

Fortunately, I found a solution. In this tutorial I will show you how you can be able to use mail() function in your local computer with the help of Mozilla Thunderbirdso you’ll know if your mail script really does work. In your XAMPP package, there’s a tool there called Mercury Mail. This app can, sort of, imitate an email provider like Gmail, Yahoo Mail, or others. But to set it up is a little bit tricky, took me hours to get it to work so I’d like to share this with you guys to save you time and frustration. :)

In case you’re wondering what Mercury Mail looks like or where to find it, here’s a snap shot:

Like for Apache and MySQL just hit Start to activate it and wait for Running to show. Then the Mercury Mail window pops up:

I started by creating a new user. Go to Configuration > Manage local users then Add. I put in the following:

Remember that error in the beginning? To get rid of it, I edited my php.ini file, search for sendmail_from and removed the semi-column (;) so that line isn’t a comment anymore (didn’t change the value).

;sendmail_from = postmaster@localhost

That’s it! But for this to work you have to restart your XAMPP. Once they’re back on (Apache, MySQL, and MercuryMail) run your PHP script, this is how mine looks like:

Warning: 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\website\Index_Public_Images\public_images.php on line 38

Not sure if XAMPP and WAMP have their folder arrangements the same, or if they even have the same folders, but if they do, try to go to C:\wamp\mercurymail (or if you don’t have this, try to look for mercury mail’s folder), create a folder in there and call it “QUEUE”.

Man :'( Can you explain me what happened here, Before I say what I’ve done to make ppl who have the same problem ffix it,
I copied the MercuryMail from XAMPP to WAMP and into both of them I put the folder as you said and named it QUEUE, and that worked like magic O.o
Thanks a lot man <3 Both of guys from BIG forums couldn't fix this <3 thanks a lot :D I was stuck there Now I can finish learning :D thank you <3