<?php
$to = "dominicsham2000@gmail.com";
$subject = "PHP Book Ch16";
$encoded_subject = "=?utf-8?B?".base64_encode($subject)."?=";
$message = "From a testing mail\n\nIf you received, the program runs successfully!";
if (mail($to, $encoded_subject, $message)) {
echo "Email successfully sent to $to_email...";
} else {
echo "Email sending failed...";
}
?>
Here is my PHP script in order to send a message to myself. The configuration of the SMTP port has no problems however it only states the failure in sending email. May I ask where is the issue and how to solve in order to successfully send to the corresponding recipient?