我在我们的网站上创建了一个表格,用于在线提交我们工作的索赔。我有两个与表单相关联的页面。我有一个后端 .php 页面,其中包含感谢您提交和将电子邮件发布到我们公司地址的代码。填写表格然后提交时,我们没有收到电子邮件。我对编码很陌生,这是我第一次尝试创建表单。我认为我有必要的代码和 .php 来执行此操作。我非常感谢有关如何通过电子邮件发送此表格的任何意见。我的表单页面如下所示:
-<!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">
<!-- InstanceBegin template="Templates/main_page.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Assignment Submission</title>
<!--[if lte IE 9]>
<style type="text/css" title="ie-style-css">
/* lte IE 9 style*/
</style>
<![endif]-->
<!-- InstanceEndEditable -->
<link href="stylesheets/reset.css" rel="stylesheet" type="text/css" />
<link href="stylesheets/index.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="scripts/browser-compatibility.js"></script>
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
<script type="text/javascript" src="http://cdn.wibiya.com/Toolbars/dir_1424/Toolbar_1424727/Loader_1424727.js"></script>
</head>
<body>
<noscript>
<a href="http://www.wibiya.com/">Web Toolbar by Wibiya</a>
</noscript>
<div class="main_wrapper cf">
<div class="header cf">
<div class="logo_holder cf"></div>
<div class="nav_holder cf">
<ul class="hmenubar cf">
<li><a href="index.html" class="clicked" target="_self">Home</a> </li>
<li><a href="about.html">About</a> </li>
<li><a href="services.html">Services</a> </li>
<li><a href="coverage.html">coverage</a> </li>
<li><a href="assignment.html">submit an assignment</a> </li>
<li><a href="solutions.html">Resources</a> </li>
<li><a href="contact.html">Contact</a> </li>
<script type="text/javascript" src="scripts/menu_selection.js"></script>
</ul>
</div>
</div>
<div class="content cf"> <!-- InstanceBeginEditable name="ContentRegion" -->
<div class="column_1">
<h2 class="about">Assignment Submission Form</h2>
<h2 class="service_text"><font color="#FF0000">PLEASE BE AWARE WE ARE EXPERIENCING DIFFICULTIES WITH OUR ONLINE SUBMISSION FORM. PLEASE CONTACT US TO PROVIDE US WITH AN ASSIGNMENT AT THIS TIME. (xxx) xxx-xxxx. Thank you.</font><br />
Please complete as many fields as possible and click submit at the bottom of the page. We will contact you with a confirmation. If you do not hear from us within 2 hours of submission, please contact us. </h2>
<form id="new_assignment" name="Assignment Form" method="post" action="result.php" class="assign_form">
<hr />
<h1 class="revtitle" style="color: rgb(157, 72, 61); text-align: left;">Client Information</h1>
<hr />
<p class="paragraph2">
<label>Company Name:</label>
<input name="company" type="text" required="required" form="new_assignment" tabindex="1" style="width:225px" />
<br/>
<label>Adjuster:</label>
<input name="adj" type="text" required="required" form="new_assignment" tabindex="2" style="width:200px" />
<label>E-mail:</label>
<input name="email" type="email" required="required" form="new_assignment" tabindex="3" style="width:250px" />
<br/>
<label>Phone Number:</label>
<input name="adj_phone_number" type="tel" required="required" form="new_assignment" tabindex="4" style="width:100px" />
<label>Extension:</label>
<input name="ext" type="text" form="new_assignment" tabindex="5" style="width:40px" />
<label>Fax Number:</label>
<input name="fax" type="tel" form="new_assignment" tabindex="6" style="width:100px" />
</p>
<hr />
<div class="claim_info">
<h1 class="revtitle" style="color: rgb(157, 72, 61); text-align: left;">Claim Information</h1>
<hr />
<p class="paragraph2">
<label>Assignment Type:</label>
<select name="assign_type" form="new_assignment" tabindex="7" title="Assignment Type">
<option value="auto" selected="selected">Automobile</option>
<option value="rec">Recreational</option>
<option value="heavy">Heavy Equipment</option>
<option value="property">Minor Property</option>
<option value="audit">Estimate Audit</option>
<option value="scene_invest">Scene Investigation</option>
<option value="arb">Arbitration</option>
<option value="DRP">DRP Quality Control Inspection</option>
<option value="photos">Photos Only</option>
</select>
<label>Type of Loss:</label>
<select name="loss_type" form="new_assignment" tabindex="8" title="Loss Type">
<option value="coll">Collision</option>
<option value="comp">Comprehensive</option>
<option value="other">Other</option>
</select>
<br/>
<label>Claim #:</label>
<input name="claim_#" type="text" required="required" form="new_assignment" tabindex="9" style="width:225px" />
<label>Policy #:</label>
<input name="policy_#" type="text" form="new_assignment" tabindex="10" style="width:150px" />
<br/>
<label>Deductible: </label>
<input name="deductible" type="text" form="new_assignment" tabindex="11" style="width:100px" />
<label>Date of Loss: </label>
<input name="dol" type="date" form="new_assignment" tabindex="12" style="width:150px" />
<br />
</p>
<div class="insd_info">
<label>Insured:</label>
<input name="insured" type="text" required="required" form="new_assignment" tabindex="13" style="width:200px" />
<br/>
<label>Address:</label>
<input name="insd_address" type="text" form="new_assignment" tabindex="14" style="width:275px" />
<br/>
<label>City:</label>
<input name="insd_city" type="text" form="new_assignment" tabindex="15" style="width:120px" />
<label>State:</label>
<select name="insd_state" form="new_assignment" tabindex="16" title="Insured State">
<option value="AL">AL</option>
<option value="AK">AK</option>
<option value="AZ">AZ</option>
<option value="AR">AR</option>
<option value="CA">CA</option>
<option value="CO">CO</option>
<option value="CT">CT</option>
<option value="DE">DE</option>
<option value="FL">FL</option>
<option value="GA">GA</option>
<option value="HI">HI</option>
<option value="ID">ID</option>
<option value="IL">IL</option>
<option value="IN">IN</option>
<option value="IA">IA</option>
<option value="KS">KS</option>
<option value="KY">KY</option>
<option value="LA">LA</option>
<option value="ME">ME</option>
<option value="MD">MD</option>
<option value="MA">MA</option>
<option value="MI" selected="selected">MI</option>
<option value="MN">MN</option>
<option value="MS">MS</option>
<option value="MO">MO</option>
<option value="MT">MT</option>
<option value="NE">NE</option>
<option value="NV">NV</option>
<option value="NH">NH</option>
<option value="NJ">NJ</option>
<option value="NM">NM</option>
<option value="NY">NY</option>
<option value="NC">NC</option>
<option value="ND">ND</option>
<option value="OH">OH</option>
<option value="OK">OK</option>
<option value="OR">OR</option>
<option value="PA">PA</option>
<option value="RI">RI</option>
<option value="SC">SC</option>
<option value="SD">SD</option>
<option value="TN">TN</option>
<option value="TX">TX</option>
<option value="UT">UT</option>
<option value="VT">VT</option>
<option value="VA">VA</option>
<option value="WA">WA</option>
<option value="WV">WV</option>
<option value="WI">WI</option>
<option value="WY">WY</option>
</select>
<br/>
<label>Zip Code:</label>
<input name="insd_ZIP" type="text" form="new_assignment" tabindex="17" style="width:130px" />
<br/>
<label>Home Phone:</label>
<input name="insd_home" type="tel" form="new_assignment" tabindex="18" style="width:140px" />
<br/>
<label>Work Phone:</label>
<input name="insd_work" type="tel" form="new_assignment" tabindex="19" style="width:140px" />
<br/>
<label>Mobile Phone:</label>
<input name="insd_mobile" type="tel" form="new_assignment" tabindex="20" style="width:140px" />
<br/>
<label>Other Phone:</label>
<input name="insd_other" type="tel" form="new_assignment" tabindex="21" style="width:140px " />
<br/>
</div>
<div class="claimant_info ">
<label>Claimant:</label>
<input name="claimant " type="text " required="required " form="new_assignment " tabindex="22" style="width:200px " />
<br/>
<label>Address:</label>
<input name="claimant_address " type="text " form="new_assignment " tabindex="23" style="width:275px " />
<br/>
<label>City:</label>
<input name="claimant_city " type="text " form="new_assignment " tabindex="24" style="width:120px " />
<label>State:</label>
<select name="claimant_state " form="new_assignment " tabindex="25" title="Claimant State ">
<option value="AL ">AL</option>
<option value="AK ">AK</option>
<option value="AZ ">AZ</option>
<option value="AR ">AR</option>
<option value="CA ">CA</option>
<option value="CO ">CO</option>
<option value="CT ">CT</option>
<option value="DE ">DE</option>
<option value="FL ">FL</option>
<option value="GA ">GA</option>
<option value="HI ">HI</option>
<option value="ID ">ID</option>
<option value="IL ">IL</option>
<option value="IN ">IN</option>
<option value="IA ">IA</option>
<option value="KS ">KS</option>
<option value="KY ">KY</option>
<option value="LA ">LA</option>
<option value="ME ">ME</option>
<option value="MD ">MD</option>
<option value="MA ">MA</option>
<option value="MI " selected="selected">MI</option>
<option value="MN ">MN</option>
<option value="MS ">MS</option>
<option value="MO ">MO</option>
<option value="MT ">MT</option>
<option value="NE ">NE</option>
<option value="NV ">NV</option>
<option value="NH ">NH</option>
<option value="NJ ">NJ</option>
<option value="NM ">NM</option>
<option value="NY ">NY</option>
<option value="NC ">NC</option>
<option value="ND ">ND</option>
<option value="OH ">OH</option>
<option value="OK ">OK</option>
<option value="OR ">OR</option>
<option value="PA ">PA</option>
<option value="RI ">RI</option>
<option value="SC ">SC</option>
<option value="SD ">SD</option>
<option value="TN ">TN</option>
<option value="TX ">TX</option>
<option value="UT ">UT</option>
<option value="VT ">VT</option>
<option value="VA ">VA</option>
<option value="WA ">WA</option>
<option value="WV ">WV</option>
<option value="WI ">WI</option>
<option value="WY ">WY</option>
</select>
<br/>
<label>Zip Code:</label>
<input name="claimant_ZIP " type="text " form="new_assignment " tabindex="26" style="width:130px " />
<br/>
<label>Home Phone:</label>
<input name="claimant_home " type="tel " form="new_assignment " tabindex="27" style="width:140px " />
<br/>
<label>Work Phone:</label>
<input name="claimant_work " type="tel " form="new_assignment " tabindex="28" style="width:140px " />
<br/>
<label>Mobile Phone:</label>
<input name="claimant_mobile " type="tel " form="new_assignment " tabindex="29" style="width:140px " />
<br/>
<label>Other Phone:</label>
<input name="claimant_other" type="tel" form="new_assignment" tabindex="30" style="width:140px" />
</div>
</div>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br />
<hr />
<h1 class="revtitle" style="color: rgb(157, 72, 61); text-align: left;">Vehicle Information</h1>
<hr />
<p class="paragraph2">
<label>Owner of vehicle to be inspected: </label>
<select name="owner_type" form="new_assingments" tabindex="31" style="width:160px">
<option value="insd" selected="selected">Insured</option>
<option value="clmt">Claimant</option>
</select>
<br />
<label>Year: </label>
<input name="veh_year" type="text" for="new_assignment" tabindex="32" style="width:80px" />
<label>Make: </label>
<input name="veh_make" type="text" form="new_assignment" tabindex="33" style="width:100px" />
<label>Model: </label>
<input name="veh_model" type="text" form "new_assigment" tabindex="34" style="width:100px" />
<label>Color: </label>
<input name="veh_color" type="text" form="new_assignment" tabindex="35" style="width:100px" />
<br/>
<label>VIN: </label>
<input name="veh_VIN" type="text" form="new_assignment" tabindex="36" style="width:200px" />
<label>License Plate: </label>
<input name="lic_plate" type="text" form="new_assignment" tabindex="37" style="width:100px" />
<label>State:</label>
<select name="license_state " form="new_assignment " tabindex="38" title="License State ">
<option value="AL ">AL</option>
<option value="AK ">AK</option>
<option value="AZ ">AZ</option>
<option value="AR ">AR</option>
<option value="CA ">CA</option>
<option value="CO ">CO</option>
<option value="CT ">CT</option>
<option value="DE ">DE</option>
<option value="FL ">FL</option>
<option value="GA ">GA</option>
<option value="HI ">HI</option>
<option value="ID ">ID</option>
<option value="IL ">IL</option>
<option value="IN ">IN</option>
<option value="IA ">IA</option>
<option value="KS ">KS</option>
<option value="KY ">KY</option>
<option value="LA ">LA</option>
<option value="ME ">ME</option>
<option value="MD ">MD</option>
<option value="MA ">MA</option>
<option value="MI ">MI</option>
<option value="MN ">MN</option>
<option value="MS ">MS</option>
<option value="MO ">MO</option>
<option value="MT ">MT</option>
<option value="NE ">NE</option>
<option value="NV ">NV</option>
<option value="NH ">NH</option>
<option value="NJ ">NJ</option>
<option value="NM ">NM</option>
<option value="NY ">NY</option>
<option value="NC ">NC</option>
<option value="ND ">ND</option>
<option value="OH ">OH</option>
<option value="OK ">OK</option>
<option value="OR ">OR</option>
<option value="PA ">PA</option>
<option value="RI ">RI</option>
<option value="SC ">SC</option>
<option value="SD ">SD</option>
<option value="TN ">TN</option>
<option value="TX ">TX</option>
<option value="UT ">UT</option>
<option value="VT ">VT</option>
<option value="VA ">VA</option>
<option value="WA ">WA</option>
<option value="WV ">WV</option>
<option value="WI ">WI</option>
<option value="WY ">WY</option>
</select>
<br/>
<label>Description of Loss: </label>
<textarea name="desc_of_loss" id="desc_of_loss" form="new_assignment" tabindex="39" style="width:500px"></textarea>
<br />
<label>Description of Damage: </label>
<textarea name="desc_of_dmg" id="desc_of_dmg" form="new_assignment" tabindex="40" style="width:500px"></textarea>
<br />
</p>
<hr />
<h1 class="revtitle" style="color: rgb(157, 72, 61); text-align: left;">Vehicle Location</h1>
<hr />
<p class="paragraph2">
<label>Location Name: </label>
<input name="location_name" type="text" form="new_assignment" style="width:250px" tabindex="41" value="With Owner" />
<br />
<label>Address: </label>
<input name="location_address" type="text" form="new_assignment" style="width:300px" tabindex="42" value="(same as owner above)" />
<br />
<label>City:</label>
<input name="insd_city" type="text" form="new_assignment" tabindex="43" style="width:120px" />
<label>State:</label>
<select name="insd_state" form="new_assignment" tabindex="44" title="Insured State">
<option value="AL">AL</option>
<option value="AK">AK</option>
<option value="AZ">AZ</option>
<option value="AR">AR</option>
<option value="CA">CA</option>
<option value="CO">CO</option>
<option value="CT">CT</option>
<option value="DE">DE</option>
<option value="FL">FL</option>
<option value="GA">GA</option>
<option value="HI">HI</option>
<option value="ID">ID</option>
<option value="IL">IL</option>
<option value="IN">IN</option>
<option value="IA">IA</option>
<option value="KS">KS</option>
<option value="KY">KY</option>
<option value="LA">LA</option>
<option value="ME">ME</option>
<option value="MD">MD</option>
<option value="MA">MA</option>
<option value="MI" selected="selected">MI</option>
<option value="MN">MN</option>
<option value="MS">MS</option>
<option value="MO">MO</option>
<option value="MT">MT</option>
<option value="NE">NE</option>
<option value="NV">NV</option>
<option value="NH">NH</option>
<option value="NJ">NJ</option>
<option value="NM">NM</option>
<option value="NY">NY</option>
<option value="NC">NC</option>
<option value="ND">ND</option>
<option value="OH">OH</option>
<option value="OK">OK</option>
<option value="OR">OR</option>
<option value="PA">PA</option>
<option value="RI">RI</option>
<option value="SC">SC</option>
<option value="SD">SD</option>
<option value="TN">TN</option>
<option value="TX">TX</option>
<option value="UT">UT</option>
<option value="VT">VT</option>
<option value="VA">VA</option>
<option value="WA">WA</option>
<option value="WV">WV</option>
<option value="WI">WI</option>
<option value="WY">WY</option>
</select>
<br/>
<label>Zip Code: </label>
<input name="insd_ZIP" type="text" form="new_assignment" tabindex="45" style="width:130px" />
<label>Contact: </label>
<input name="location_contact" type="text" form="new_assignment" tabindex="46" style="width:150px" />
<br/>
</p>
<hr />
<input type="reset" class="button" />
<input name="submit" type="submit" class="button" form="new_assignment" formaction="/result.php" formenctype="multipart/form-data" formmethod="POST" value="Submit" />
<p></p>
<div class="important" id="important">
<label>Trojan</label>
<input type="text" name="trojan" id="trojan" />
</div>
</form>
</div>
<!-- InstanceEndEditable --> </div>
<div class="footer cf">
<p class="rights">LMC Insurance Services, INC - 2013 All Rights Reserved | <a class="privacy" href="/privacy_policy.html" target="_self">Privacy Policy</a> </p>
</div>
</div>
</body>
<!-- InstanceEnd -->
</html>
我的 .php 结果页面显示为:
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Submission</title>
</head>
<body>
<?PHP
//checks if bot
if($_POST['trojan']!='');
die("Changed field");
$adj = $_POST['adj'];
$company = $_POST['company'];
$email = $_POST['email'];
$adj_phone = $_POST['adj_phone_number'];
$ext = $_POST['ext'];
//Sending Email to form owner
$header = "From: $email\n"
. "Relpy-To: $email\n";
$subject = "New Assignment from Website";
$email_to = "office@example.com";
$message = "We recieved a new assignment from $adj \n"
. "They can be reached at $adj_phone $ext \n"
. "Their e-mail address is $email \n";
mail($email_to,$subject,$message,$header);
?>
<h1>Thank you for your submission!</h1>
<p>Your information has been sent, and our office will contact you to verify the assignment and confirm any special instructions.</p>
<p>We thank you for utilizing our services. We hope to complete your assignment in a timely manner.</p>
</body>
</html>
非常感谢任何和所有帮助。