php contact form
Posted: Fri Jul 10, 2015 3:29 am
That's the code that I am using, but it is not working. Can anyone help?
In the form I am asking for name and email address to subscribe. But this is the error message that comes
PHP Warning: mail(): SMTP server response: 550 Requested action not taken: mailbox unavailable or not local in D:\inetpub\vhosts\legalyaar.com\httpdocs\contact.php on line 9
In the form I am asking for name and email address to subscribe. But this is the error message that comes
PHP Warning: mail(): SMTP server response: 550 Requested action not taken: mailbox unavailable or not local in D:\inetpub\vhosts\legalyaar.com\httpdocs\contact.php on line 9
Code: Select all
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$formcontent="Name: $name\n\nEmail: $email\n\nMessage: $message";
// Enter the email where you want to receive the notification when someone submit form
$recipient = "anjali@legalyaar.com";
$subject = "Comingsoon! Contact Form";
$mailheader = "From: $email\\r\\n";
$mailheader .= "Reply-To: $email\\r\\n";
$mailheader .= "MIME-Version: 1.0\\r\\n";
$success = mail($recipient, $subject, $formcontent, $mailheader);
if ($success == true){
?>
<script language="javascript" type="text/javascript">
alert('Thank you for subscribing to our newsletters.');
window.location = "../index.html";
</script>
<?php
} else {
?>
<script language="javascript" type="text/javascript">
alert('Message not sent.');
window.location = "../index.html";
</script>
<?php
}
?>