In my following code it working fine for one email id but when I changed $to
with two email id like $to = "test1@gmail.com,test2@gmail.com"
then it not sent email to receptions emails.
$to = "test1@gmail.com";
$subject = "Student details";
$msg = "Body Message here";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
if(mail($to,$subject,$msg,$headers))
{
echo "email sent successfully";
}
Might be this question look like silly but it difficult for me to debug why it is not working for multiple email.