Answers for "how to configure php.ini to send email from gmail from localhost"

0

how to configure php.ini to send email from gmail from localhost

<?php
$to_email = "[email protected]";
$subject = "Simple Email Test via PHP";
$body = "Hi,nn This is test email send by PHP Script";
$headers = "From: sender\'s email";
 
if (mail($to_email, $subject, $body, $headers)) {
    echo "Email successfully sent to $to_email...";
} else {
    echo "Email sending failed...";
}
Posted by: Guest on March-31-2021

Code answers related to "how to configure php.ini to send email from gmail from localhost"

Browse Popular Code Answers by Language