I'm trying send to a gmail, using xampp.
my PHP version is 5.6.8
Using this source as a guide, I changed the config of my php.ini and sendmail.ini But it didn't work for me. The page always display Failure: Email was not sent!
This is my php:
$to = 'kennybanny12@gmail.com';
$subject = 'No subject';
$message = 'Hello, this is the content of the email.';
$headers = 'From: sticollegesocial@gmail.com';
if(mail($to, $subject, $message, $headers)) {
echo 'Email sent successfully!';
} else {
die('Failure: Email was not sent!');
}
These are the things that I changed in my php.ini:
SMTP=smtp.gmail.com
smtp_port=587
sendmail_from = sticollegesocial@gmail.com
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
sendmail.ini:
smtp_server=smtp.gmail.com
smtp_port=587
error_logfile=error.log
debug_logfile=debug.log
auth_username=sticollegesocial@gmail.com
auth_password=**********
force_sender=sticollegesocial@gmail.com