Page 1 of 1

Xampp Email Problem

PostPosted: 13. October 2017 18:27
by Shinamori
Hello,

I'm having trouble using Xampp to send emails through localhost. My code is as follows:
<?php
$emailTo = "myEmail@gmail.com";
$subject = "Feedback";
$content = "test email";
$results = mail($emailTo, $subject, $content);
echo "results: " . $results;
?>

$results returns nothing for some reason. The mail also does not arrive, even though I have set up the gmail account to allow access for insecure apps.

Sendmail looks like:

smtp_server=smtp.gmail.com
smtp_port=587
error_logfile=error.log
debug_logfile=debug.log
auth_username=myEmail@gmail.com
auth_password=myPassword
force_sender=myEmail@gmail.com

And php.ini:

SMTP=smtp.gmail.com
smtp_port=587
sendmail_from = myEmail@gmail.com
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

I'm also getting "[Thu Oct 12 10:25:09.648081 2017] [ssl:warn] [pid 3232:tid 560] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name" in the error log when I restart xampp sometimes, but I can still access localhost and use localhost in my internet browser.

None of the guides I've looked at have helped and I've already tried turning off my firewall/antivirus, using port 465, and checking spam folders in the receiving email address. Could anyone offer me advice on what I can try to do, and also let me know if there are new issues with Xampp, netbeans, or gmail that the online guides might be outdated on? Thanks in advance for any help provided.

Re: Xampp Email Problem

PostPosted: 14. October 2017 10:59
by Chikwado
You Seem To Have Run Into Some Php Bug. Check The Following File If It Is There: C:/xampp/sendmail/sendmail.exe.

Re: Xampp Email Problem

PostPosted: 14. October 2017 20:20
by Nobbie
And php.ini:

SMTP=smtp.gmail.com
smtp_port=587
sendmail_from = myEmail@gmail.com
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"


You MUST NOT activate SMPT / smtp_port in php.ini, thats wrong. Delete that lines or comment out. The Gmail SMTP server is accessed via sendmail.exe and not twice also via php.ini.