I just need that when form is submitted mail is send to recipient. My form submitted with Response code of 200k but mail is not Delivered. I have installed sendmail.
sendmail.php code:
if(isset($_POST['submit']))
{
$subject = $_POST['subject'];
$to = "abc@gmail.com";
$from = $_POST['email'];
//data
$msg = "NAME: " .$_POST['name'] ."<br>\n";
$msg .= "EMAIL: " .$_POST['email'] ."<br>\n";
$msg .= "WEBSITE: " .$_POST['web'] ."<br>\n";
$msg .= "COMMENTS: " .$_POST['comments'] ."<br>\n";
//Headers
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=UTF-8\r\n";
$headers .= "From: <".$from. ">" ;
mail ($to, $subject,$msg, $headers);
echo "sent";
}
installed mail server in php.ini file:
[mail function]
; Setup for Linux systems
sendmail_path = /usr/sbin/sendmail -t
sendmail_from = me@myserver.com