I have developed a website and want to send emails from the website domain I have configured mail function before it worked well then but after few months its not working here is my code
$email_from = 'xxx@domainname.lk';//<== update the email address
$email_subject = "New Visitor";
$email_body = "new visitor".
$to = 'qqq@gmail.com';//<== update the email address
$headers .= "From: $email_from \r\n";
//Send the email!
mail($to,$email_subject,$email_body,$headers);
//done. redirect to thank-you page.
header('Location: thank-you.html');
I think the value of $email_body variable should end with semicolon (;) and also $headers should be written like below
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();