I'm using the below code to send mail. Only the User who submits the form receives mail but not the admin.
I have tried with "$mail_to = "admin@sampledemos.online";"
and include the same in mail function ()
and also included the mail address directly in the mail function as "mail($email_from, $mail_title, $mail_body, $headers, "admin@sampledemos.online") )"
, but still admin didn't receive any mail so far.
$headers = "From: $email_from\nMIME-Version: 1.0\nContent-type: text/html; charset=iso-8859-1\n";
$mail_to = "admin@sampledemos.online";
if( mail($email_from, $mail_title, $mail_body, $headers, "admin@sampledemos.online") ) {
$serialized_data = '{"type":1, "message":"Contact form successfully submitted. Thank you, I will get back to you soon!"}';
echo $serialized_data;
} else {
$serialized_data = '{"type":0, "message":"Contact form failed. Please send again later!"}';
echo $serialized_data;
}
};