Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

Am working on html page. In the contact page i need send message to user. When am clicking the button i need to send some message to mail.

<form method="post" action="phpmail.php">
<table>
</table>
</form>

am writing some code inside the phpmail.php is bellow

<title>PHP email function</title><div>

<?php
$name=$_POST['name'];
$email=$_POST['email'];
$mobile=$_POST['mobile'];
$message=$_POST['message'];

$to=info@Fb.com;
$subject="Welcome to www.webinfopedia.com";

$message="From:$name <br />Mobile:$mobile <br />".$message;

$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";

// More headers
$headers .= 'From: <info@webinfopedia.com>' . "\r\n";
$headers .= 'Cc: webinfopedia.com@gmail.com' . "\r\n";
@mail($to,$subject,$message,$headers);
if(@mail)
{
echo "Email sent successfully !!";
}
?>


when run the contact page and click on submit button ill got these error The "HTTP verb POST used to access path /php-email-function/phpmail.php' is not allowed.
Posted
Updated 29-Jan-12 6:08am
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900