Skip to content

Send Emails from XAMPP lite on Windows

November 13, 2011

This information, like anything else, exists in little random pieces on Google, sometimes outdated. So here is how I was able to get Drupal to send emails from my localhost server using XAMPP lite.

Step 1: update php.ini, located at C:/xampplite/php/php.ini

[mail function]
; For Win32 only.
; http://php.net/smtp
;SMTP = localhost
; http://php.net/smtp-port
;smtp_port = 25

; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = postmaster@localhost

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
;sendmail_path = "\"C:\xampplite\sendmail\sendmail.exe\" -t"
sendmail_path = "C:\xampplite\sendmail\sendmail.exe -t -i"

; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =

; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
mail.add_x_header = Off

; Log all mail() calls including the full path of the script, line #, to address and headers
;mail.log = "C:\xampplite\apache\logs\php_mail.log"

Step 2: Update sendmail

  • go to http://glob.com.au/sendmail/ and grab the latest sendmail zip file
  • unzip to desktop and copy the files into your \xampp\sendmail folder replacing everything that was there.
  • edit sendmail.ini (remember to change ‘myemail’ and ‘mypassword’):
smtp_server=smtp.gmail.com
smtp_port=465
smtp_ssl=auto
auth_username=myemail@gmail.com
auth_password=mypassword
force_sender=myemail@gmail.com
hostname=smtp.gmail.com

One word of caution: if you are using a firewall like me, you’ll need to give access to sendmail.exe.

About these ads

From → Web Development

3 Comments
  1. Hi

    Thanks for help. I have spent some time looking for this solution.

    Had problem with php mail() function on xampp localhost.
    I have XAMPP for Windows 1.7.7 20.9.2011 on Vista.

    Looks like leates version of xampp 20.09.2011 still use sendmail version 24 (dec 2, 2008).
    hmm……

  2. Anonymous permalink

    it helped me…thanks for the article

  3. glen permalink

    Wow! It Really DID work! thanks a million!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: