1

My webpage allows user to fill out a contact form and send an email through PHP. It seems to execute successfully, since it takes the user to "contact.html" as a result. To troubleshoot the issue, I have checked my spam folder in Gmail.

But I still can't find my email, and don't know why. I'm not familiar with how php works; if the problem has to do with that, then I would appreciate an explanation.

here is the code

<?php

$to ="patilsakshi610@gmail.com";
$subject = $_POST['subject'];

$name = $_POST['name'];
$email = $_POST['email'];
$msg = $_POST['msg'];

$headers ="Content-type: text/html\r\n";
$headers ="From: $email";

$from=$_POST['email'];

if(isset($_POST['submit']))
{
    if(mail($to,$subject,$msg,$name))
    { ?>
        <script language="javascript" type="text/javascript">
         alert("your mail has been sent successfully");
         window.location='contact.html';
        </script>
        <?php
        
    }
}
?>

1 Answers1

0

it probleby your ip blocked by gmail. try to use devoleped php mailer lie phpmailer

so you can develop it mail system faster

cangak
  • 136
  • 10