PHP code:
<?php
if($_POST["submit"])
{
$recipient="yourmailid@domain.com"; //Enter
recipient mail address
$subject="Contact from Website"; //Subject
$sender=$_POST["name"];
$senderEmail=$_POST["email"];
$message=$_POST["comments"];
$mailBody="Name: $sender\nEmail
Address: $senderEmail\n\nMessage: $message";
mail($recipient, $subject, $mailBody);
sleep(1);
header("Location:http://blog.antonyraphel.in/sample/");
// Set
here redirect page or destination page
}
?>
hi anton
ReplyDeletewhere i need to paste the php code?
i cant send mail.
when i click submit its redirect to my main page but without any mail sending
thanx
Are you downloaded the source code that I attached here? You have to include PHP code in form action.
Deletebro i didn't get any email in my gmail . i uploaded local server , i edit my mail address in your php code, need help bro
ReplyDeleteIn localhost it doesn't work. You have to upload it in web server and try.
Delete