Why the below code not sending mail to me? What is the error?
<?php
if(isset($_POST['name'])){
$msg="Name: ".$_POST['name']."\n Email: ".$_POST['email']."\n Address: ".$_POST['city']."\n Phone: ".$_POST['phone'];
mail('sganake@gmail.com', 'New Trial Request', $msg);
echo '<h2 align="center" style="color:green">Thank you for your message.</h2>';
} ?>
No error I got. Just I have not received my email at inbox. This is running on IIS Server.
Try this
If you get
'Something went wrong'it means problem is in your mail server and not in PHP code.