0

I have saw lots of post on xampp mail google smtp but didn't get any soultion

I have a issue with in my localhost XAMPP server

And I don't want to use any external library

I want to send mails from my localhost using google smtp

the PHP mail returns true but my inbox is empty

the PHP mail code is

<?php
$headers = "From: nitin <mymail@gmail.com>\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\n";
if (mail('mymail@gmail.com', 'test mail', 'mail verify', $headers)) {
    echo "yes";
} else {
    echo "fail";
}
?>

I have configured php.ini file

[mail function]

SMTP=smtp.gmail.com

smtp_port=2587

sendmail_from = mymail@gmail.com

sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

and the sendmail.ini

[sendmail]
smtp_server=smtp.gmail.com
smtp_port=587
smtp_ssl=auto
error_logfile=error.log
debug_logfile=debug.log
auth_username=mymail@gmail.com
auth_password=pass
pop3_server=
pop3_username=
pop3_password=
force_sender=mymail@gmail.com
force_recipient=
hostname=

XAMPP Control Panel version: 3.3.0

PHP Version: 8.0.10

Platform: Windows 10

is anything I am doing wrong let me know

thank you in advance For helping

Nitin Shinde
  • 100
  • 8

0 Answers0