Code: Select all
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>EmailForm</title>
<style type="text/css">
body {
margin-left: 10px;
margin-top: 10px;
background-color: #FFF;
}
body,td,th {
color: #666;
}
</style>
<?PHP
if(isset($_POST['Submit1']))
{$Email=$_POST['Email'];
$Comments=$_POST['Comments'];
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= ‘From: madeeha.rehman5@gmail.com' . "\r\n";
if(mail('madeeha.rehman5@gmail.com','Hello',$Comments,$headers))
{echo("Your Email is sent successfully");
}
Else
{echo("Email Sending Failed");}
}
?>
</head>
<body text="#999999">
<form id="EmailForm" name="EmailForm" method="POST" action="file:///E|/Sites/EmailForm.php">
<table width="450px">
<tr><td valign="top">
<label>First Name *</label></td>
<td valign="top">
<input name="FName" type="text" size="30px" /></td></tr>
<tr><td valign="top">
<label>Last Name *</label></td><td valign="top">
<input name="LName" type="text" size="30px"/>
</td></tr>
<tr><td valign="top">
<label>Email Address *</label></td><td valign="top">
<input name="Email" type="text" size="30px"/></td></tr>
<tr><td valign="top">
<label>Comments *</label></td><td valign="top">
<textarea name="Comments" cols="25" rows="5"></textarea></td></tr>
<tr><td colspan="2" style="text-align:center">
<input name="Submit1" type="Submit" value="Submit" style="color:#000" /></td></tr>
</table>
</form>
</body>
</html>