日期:2014-05-16  浏览次数:20326 次

请帮我看看邮件验证程序不行
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<Script language="javascript" >
function validate_form() {
 validity = true;
 if (!check_empty(document.form.name.value))
 { validity = false; alert( 'Sorry!Please Fill in your name '); }
  if (!check_email(document.form.email.value))
 { validity = false; alert( 'Sorry!Please Fill in the correct Email address '); }
  if (!check_empty(document.form.company.value))
 { validity = false; alert( 'Sorry!Please Fill in your company '); }
  if (validity)
 alert (" Thanks for your register, "
 + " we will inform you soon ");
 return validity; 
}
function check_empty(text) {
 return (text.length > 0); 
}
function check_email(address) {
 if ((address == "")
  ¦ ¦ (address.indexOf ( '@ ') == -1)
  ¦ ¦ (address.indexOf ( '. ') == -1))
 return false;
 return true;
 }
</Script>
<body >
  <form name="form" onSubmit="return validate_form()" method="post" action="mailto:duji0002@ntu.edu.sg?subject=Register Training" enctype="text/plain" >
  <p>You can press &quot;Ctrl&quot; for multiple selection </p>
  <p>
  <Select Name="The Trainings" Multiple>  
  <Option value="1.Grounding type according to IEC 60364-4-41 and their protection" Selected>Grounding type according to IEC 60364-4-41 and their protection</Option>  
  <Option value="2.Power Quality problem and the mitigation solutions">Power Quality problem and the mitigation solutions</Option>  
  <Option value="3.Lightning protection earth measurement and soil resistivity measurement">Lightning protection earth measurement and soil resistivity measurement</Option>  
  <Option value="4.Power factor and harmonics correction">Power factor and harmonics correction</Option>  
  <Option value="5.Communication protocol & software training">Communication protocol & software training</Option>  
  </Select>
  </p>
  <p align="center" > <font size="3" > <b > <font size="4" face="Verdana, Arial, Helvetica, sans-serif" >Name </font >: </b > </font > 
  <input name="name" type="text" id="name" size=46 >
  <br >
  <b > <font size="4" face="Verdana, Arial, Helvetica, sans-serif" >Email </font > <font size="4" > </font > <font size="3" >: </font > </b > 
  <input name="email" type="text" id="email" size=46 >
  <br >
  <b > <font size="4" face="Verdana, Arial, Helvetica, sans-serif" >Company </font > <font size="4" > </font > <font size="3" >: </font > </b > 
  <input name="company" type="text" id="company" size=46 >
  <br >
  <b > <font size="4" face