I am creating single page application in HTML.I am new to PHP. In that I have a Leave a comment Page. I have text box to enter the name and email. I have the button while clicking the button mail will be send to the user. I am writing the email code in PHP.
My Code is
HTML CODE
LEAVE YOUR COMMENT
Your Comment...
PHP Code :
service.php file
<?php
include('config.php');
$name=$_POST['name'];
$email=$_POST['email'];
$cmt = $_POST['cmt'];
$message=$_POST['message'];
if ($_SERVER["REQUEST_METHOD"] == "POST") {
//mail code
$to = $_POST['email'];
$email_subject = "Dear $name";
$email_body = "Thank you for inquiring about our Services advertised on our webSite.
Each of the listed services we offer are uniquely different.
One of our representatives will contact you soon, would help and appreciate if you can drop a line with a suitable
Date and Time for a Phone / Skype discussion.
Once again, thank you for your interest in our services.
Cordially,
".
//mail code
// $email_to = "venkatj@acute.company";
$email_to = "sbshnr@gmail.com";
$email_sub = "Enquiry from contact us form";
$email_bod =
"$name
".
$headers = "From:nisha@acute.company";
mail($to,$email_subject,$email_body,$headers);
mail($email_to,$email_sub,$email_bod,$headers);
echo 'alert("Thank you admin will contact you soon...!");window.location.assign("Contact_us.html");';
//header('Location: contact.php');
?>
My problem is Email not send while clicking the button.
I Installed WaMp in My machine. It is in orange color while checking i got an error as
Your port 80 is actually used by
Server:Microsoft-IIS/7.5
Is there any way to correct this error?
Can anyone please help me
0 comments:
Post a Comment