XAMPP 1.8.2 Gmail setting on Windows 8

Problems with the Windows version of XAMPP, questions, comments, and anything related.

XAMPP 1.8.2 Gmail setting on Windows 8

Postby cooun » 09. July 2013 07:38

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:

[php.ini]

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.
; http://php.net/sendmail-from
sendmail_from = xxxxx@gmail.com

; 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
sendmail_path="C:\xampp\mailtodisk\mailtodisk.exe"

; 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:\xampp\php\logs\php_mail.log"



[sendmail.ini]

Code: Select all
smtp_server=smtp.gmail.com
smtp_port=25
smtp_ssl=tls
tls_certcheck off
error_logfile=error.log
debug_logfile=debug.log
auth_username=xxxxx@gmail.com
auth_password=xxxxx


Thanks a lot for your help in advance!!
cooun
 
Posts: 1
Joined: 09. July 2013 07:13
XAMPP Version: 5.6.3
Operating System: Windows 8

Re: XAMPP 1.8.2 Gmail setting on Windows 8

Postby juan.conde » 26. May 2014 06:24

In php.ini
Code: Select all
smtp_port = 587
sendmail_path = "C:\xampp\sendmail\sendmail.exe -t"
mail.add_x_header=Off


In sendmail.ini

Code: Select all
smtp_server=smtp.gmail.com
smtp_port=587
smtp_ssl=auto
error_logfile=error.log
auth_username=xxaayy@gmail.com
auth_password=kskcmhlrjr

pop3_server=
pop3_username=
pop3_password=

force_sender=xxaayy@gmail.com

force_recipient=
hostname=


To account gmail "auth_password" you need create new password "Your application-specific passwords", check https://support.google.com/a/answer/1032419

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 = "aaaaaaa@domain.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
$headers = "From: xxaayy@gmail.com" . "\r\n";
if (mail($to, $subject, $body, $headers)) {
    echo ("Message successfully sent!");
} else {
    echo ("Message delivery failed...");
}
juan.conde
 
Posts: 1
Joined: 26. May 2014 06:14
XAMPP Version: 1.8.2-1
Operating System: Window 8.1


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 51 guests