How to use sendmail in XAMPP for Windows using AOL Mail

The easiest way to start developing in PHP is to get XAMPP, the whole package can even be placed in a flash drive. Using the free AOL Mail account also allows you to sign in to the SMTP server without TLS which allows XAMPP sendmail to work.

0. Objective

To get your PHP scripts to send an email out. This guide assumes you have XAMPP or XAMPP Lite. My environment is Windows Vista. (I use XAMPP Lite by the way.)

My XAMPP is placed in C:xampplite, so your configuration may be a little different. The files to be modified are sendmail.ini and php.ini.

1. Finding a mail host that allows non-secured connection

Previously I wrote a guide on How to use sendmail in XAMPP for Windows but some people have difficulties successfully sending out an email with their web hosts. There is nothing particularly wrong with the guide. It is because XAMPP’s sendmail is compiled without TLS options. TLS (Transport Layer Security) is the successor of SSL that is required by some mail servers for authentication. Hotmail, which just launched POP3, requires you to use TLS for example. If you are thinking of Gmail, you’re out of luck too.

AOL Mail allows non-secure authentication which means we don’t need to recompile sendmail. This guide therefore uses AOL Mail. Sign up for a free AOL Mail account.

2. Modify your sendmail.ini

Your sendmail.ini should be located in C:xampplitesendmailsendmail.ini. You only need to be concern with 4 variables here:

  1. smtp_server
  2. smtp_port
  3. auth_username
  4. auth_password

Get them filled in, feel in your own username and password. Username is your AOL Mail email account, an example would be ‘’. That is not my email by the way. Remember the SMTP port is 587.

[code lang=”bash”]

3. Modify your php.ini

XAMPP places the php.ini inside C:xamppliteapachebinphp.ini. You can open the file and do a search for ‘sendmail_path’. It’s at line 704 for me. You can simply uncomment that line.

[code]sendmail_path = “C:xampplitesendmailsendmail.exe -t”[/code]

And that’s all. Now for some testing. AOL mail requires you to use your AOL Mail email as the from_email, so I’ll be using ‘’.


3. Let’s test it out

[code lang=”php”]“;
$body = “Hi, nThis is a test mail from $from_name <$from_email>.”;
$subject = “Test mail from Justrealized”;
$to = “”;

if (mail($to, $subject, $body, $headers)) {
echo “success!”;
} else {
echo “fail…”;

Execute those codes and you should receive something in your inbox. Here’s what I see in Gmail:

And you get this in Gmail

Hope it works for you. Please correct me if I missed out anything.

(Those aren’t my email, if you sent emails there your emails will get sucked into some blackhole.)

14 thoughts on “How to use sendmail in XAMPP for Windows using AOL Mail”

  1. THANX!!! I already had it set to aol but it didn’t work! All I had to do was change the port number! WOW! THANK YOU!

  2. Ahni: Thanks for sharing. Gmail requires more security for its SMTP so I was trying to avoid that. Your method is great alternative though. Will use it if one day SSL becomes a requirement. 🙂

  3. I’m having a problem with your instructions, thanks for them by the way. I’m getting it to say success, but I’m not receiving the emails being sent and in the apache error.log I’m getting the error “sendmail.exe: F:xamppsendmailsendmail.ini: line 1: unknown command”

  4. Eh, ok. So I tried everything every single one of these sites say. Do this, do that, change this change that. And yet… mail sent success! Ok… wait, wait… nothing! Who ever made this app, fail. Sorry, besides this issue, it has many other issues. Apache2Traid Was nice, no jumping through hoops to set up something so simple. Unfortunately, no longer updated. 3 different SMTP host’s I tried. My own domain, and gmail.

    “sendmail -t -i” – Mail sent Success – But truly… not.
    “C:webxamppsendmailsendmail.exe -t” exact same thing.

    Even tried setting the SMTP in the php.ini. Done this numerous times. But why is it not working with this application?

    Yes… I restarted Apache as well. No matter what I do or what I change this simply does NOT work. And i thank you developer (i know not here) Just make development more painstakingly painful. Any time of mailing, sendmail I know have to upload to test.

  5. For those of you who say this doesn’t work, i’m not sure exactly where the problem lies, but a fresh, clean install of the latest XAMPP version and following this article from scratch will most probably fix it.. My guess is that previous versions of XAMPP work differently with SMTP and sendmail.

  6. With xampp.1.7.3
    followed the instruction.
    And it worked like charm.
    Thank so much for this article. 😀

  7. I am using Windows XP and xampp (current version).

    I tried your method, but it does not work from my desktop.

    The only uncommented part in the sendmail.ini file now is:
    auth_password= abc

    And I have inserted the following into php.ini file (this reflects the correct path):
    sendmail_path = “C:xamppsendmailsendmail.exe -t”

    Please advise, asap. Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *