<?php
ini_set('display_errors', '1');
include '../application/includes/config.php';
$mailto=$_POST['email'];
$subject="Information";
$message_body="Welcome to the digital world!";
$from="info@mydomain.com";
$mail = mail($mailto,$subject,$message_body,"From:".$from);
if($mail){
echo "Thank you for using our mail form";
}else{
echo "Mail sending failed.";
}
?>
I have tested this code on other website. It's working there but on my server it only displays "Mail sending failed" error..