Page 1 of 1

XAMPP 1.8.2 Gmail setting on Windows 8

PostPosted: 09. July 2013 07:38
by cooun
I just installed XAMPP 1.8.2 on Windows 8 and I am trying to use Gmail to send emails but it never works.

Does anyone use Gmail for sendmail on Windows 8? If so please show me your code examples.

This is my setting:


Code: Select all
[mail function]
; XAMPP: Comment out this if you want to work with an SMTP Server like Mercury
; SMTP = localhost
; smtp_port = 25

; For Win32 only.
sendmail_from =

; XAMPP IMPORTANT NOTE (1): If XAMPP is installed in a base directory with spaces (e.g. c:\program filesC:\xampp) fakemail and mailtodisk do not work correctly.
; XAMPP IMPORTANT NOTE (2): In this case please copy the sendmail or mailtodisk folder in your root folder (e.g. C:\sendmail) and use this for sendmail_path. 
; XAMPP: Comment out this if you want to work with fakemail for forwarding to your mailbox (sendmail.exe in the sendmail folder)
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

; XAMPP: Comment out this if you want to work with mailToDisk, It writes all mails in the C:\xampp\mailoutput folder

; 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

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


Code: Select all
tls_certcheck off

Thanks a lot for your help in advance!!

Re: XAMPP 1.8.2 Gmail setting on Windows 8

PostPosted: 26. May 2014 06:24
by juan.conde
In php.ini
Code: Select all
smtp_port = 587
sendmail_path = "C:\xampp\sendmail\sendmail.exe -t"

In sendmail.ini

Code: Select all



To account gmail "auth_password" you need create new password "Your application-specific passwords", check

After you need follow the next steps:

Finally I found the answer. The problem is that sendmail has to be run as an administrator. This is the solution to help any one on my situation.

1. Right click on sendmail.exe
2. Properties
3. Compatibility
4. Change the configuration for all users
5. Execute as Windows XP SP 3
6. Execute as adminitrator
7. test email

Code: Select all
$to = "";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
$headers = "From:" . "\r\n";
if (mail($to, $subject, $body, $headers)) {
    echo ("Message successfully sent!");
} else {
    echo ("Message delivery failed...");