Send Emails from XAMPP lite on Windows
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 firstname.lastname@example.org auth_password=mypassword email@example.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.