i am sorry for disturbing you again and again, by asking for being more clear i meant to please make HTML and PHP file coding separate by the way i tried by copy and pasting the coding you provided as follow.
HTML Coding is as follow (contact.html)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<table width="200" border="0">
<tr>
<td><form id="form1" name="form1" method="post" action="">
<table width="420" border="0">
<tr>
<td width="92">Name:</td>
<td width="295"><label>
<input type="text" name="name" id="name" />
</label></td>
</tr>
<tr>
<td>Email:</td>
<td><label>
<input type="text" name="email" id="email" />
</label></td>
</tr>
<tr>
<td>Inquiry about:</td>
<td><label>
<select name="inquiry" size="3" multiple="multiple" id="inquiry">
<option value="Web">Web Designing</option>
<option value="Graphics">Graphics Designing</option>
<option value="Software">Software Development</option>
</select>
</label></td>
</tr>
<tr>
<td valign="top">Message</td>
<td><label>
<textarea name="message" id="message" cols="45" rows="5"></textarea>
</label></td>
</tr>
<tr>
<td> </td>
<td><label>
<input type="submit" name="Submit" id="Submit" value="Submit" />
</label></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>
PHP Coding is as follow (contact_mail.php)
<?php
/*
this is : contact_mail.php
called from : contact.html
by the tag:
<form method="post" action="contact_mail.php">
*/
// Redirect, if not coming from contact.html
if(! isset( $_POST['name'] ) ){
header( 'location: contact.html' );
exit();
}
////// START Process Entered data //////
// The Entered name. trim any leading/trailing spaces of input
// Can NOT be empty
$e_name = trim($_POST['name']);
if( empty($e_name) ){
exit( 'You have to enter your name.<br />
Hit your "Go back" browser button!' );
}
/*
..... and so on
set all variables needed
by using indata from posted <form> values
Four (4) arguments needed for mail() function
from php.net simple example:
*/
$to = 'saad@creativostudios.net';
$subject = 'Mysite Contact.html';
$message = 'entered textarea';
$headers = 'From: visitor@somemail.com' . "\r\n" .
'Reply-To: visitor@somemail.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
////// Send the mail with DATA //////
$success = mail($to, $subject, $message, $headers);
if( $success )
{
echo( 'Your message was delivered. Thanks!' );
}
else
{
echo( 'Sorry! message could not be delivered . Try again later!' );
}
echo "<br />\n<br />\n";
echo '<a href="index.htm">Back to index page</a>';
//End The mail_contact.php
exit();
////// START Process Entered data //////
// The Entered name. trim any leading/trailing spaces of input
// Can not be empty
$e_name = trim($_POST['name']);
if( empty($e_name) ){
exit( 'You have to enter your name.<br />
Hit your "Go back" browser button!' );
}
/
<select name="inquiry" size="3" id="inquiry">
<option value="design_web">Web Designing</option>
<option value="design_graph">Graphics Designing</option>
<option value="dev_soft">Software Development</option></select>
/
$e_inquiry = $_POST['inquiry'];
switch( $e_inquiry ):
case 'design_web':
$subject = $inquiry_category = 'Inquiry - Web Designing';
break;
case 'design_graph':
$subject = $inquiry_category = 'Inquiry - Graphics Designing';
break;
case 'dev_soft':
$subject = $inquiry_category = 'Inquiry - Software Development';
break;
default:
exit('something wrong .. no such option');
break;
endswitch:
?>
i am not receiving email by pressing submit button, will you help me in this ?