I'm not able to send mail from localhost. I tried to change configuration of php.ini
and sendmail.ini
as code of both file mentioned below.
This is my mail function from php file.
if (mail("[email protected]", "this is subject", "this is testing message", "From:[email protected]")) {
echo 'Email sent successfully!';
} else {
die('Failure: Email was not sent!');
}
and here is the the php.ini
configuration:
SMTP=localhost
SMTP =smtp.gmail.com
smtp_port =587
sendmail_from [email protected]
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
and Sendmail.ini code is here:
account Gmail
tls on
tls_certcheck off
host smtp.gmail.com
from [example]@gmail.com
auth on
user [example]@gmail.com
password [**********]
port 587
account default : Gmail