bnownlater
Programmer
I have a simple form with 15 variables that I mail to one person. The process is taking 30 + seconds to complete (which seems to be high)? Is there a better way to handle this? I am using 4.2.1 with Win NT. Here is my code:
// Set the script's max execution time to 300 seconds
set_time_limit(300);
$to = "myemail@mydomain.com"; //The e-mail address to be sent to
$subject = "Submission"; //The subject line of the e-mail
$mailheaders = "From: ".trim($reviewer)."<".trim($rev_email).">\n"; //The users name will appear here
$mailheaders .= "X-Mailer: PHP\n"; //mailer
$mailheaders .= "X-Priority: 1\n"; //1 UrgentMessage, 3 Normal
$mailheaders .= "MIME-Version: 1.0\nContent-Type: text/html; charset=iso-8859-1\nTransport-Encoding: 8bit\n";//Converts text into html for the e-mail message
//$mailheaders .= "Reply-To: myemail@domain.com\n\n"; //a please reply message will display with e-mail address
$msg = "
<style>}
TD { /* set default for text in a table */
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12pt;
vertical-align: top;
}
</style>
<table>
<tr><td>
<table border=1 cellspacing=1 cellpadding=3 >
<tr><td colspan=2 align=center bgcolor='2b4e8e'><font color='ffffff'><b>Your Information</b></font></td></tr>
<tr><td><br><b>Name:</b></td><td><br> $reviewer</td></tr>
<tr><td><b>Company:</b></td><td> $rev_co</td></tr>
<tr><td><b>E-mail:</b></td><td> $rev_email</td></tr>
<tr><td><b>Phone:</b></td><td> $rev_phone</td></tr>
<tr><td colspan=2 align=center bgcolor='2b4e8e'><font color='ffffff'><b>Facility Contact Information</b></font></td></tr>
<tr><td><br><b>Facility Name:</b></td><td><br> $co_name</td></tr>
<tr><td><b>City:</b></td><td> $co_city</td></tr>
<tr><td><b>State:</b></td><td> $co_state</td></tr>
<tr><td><b>Contact Name(s):</b></td><td> $cont_name</td></tr>
<tr><td><b>Contact E-mail(s):</b></td><td> $cont_email</td></tr>
<tr><td><b>Contact Phone Number(s):</b></td><td> $cont_phone</td></tr>
<tr><td><b>Contact Fax Number(s):</b></td><td> $cont_fax</td></tr>
<tr><td><b>Federal ID Number:</b></td><td> $fed_id</td></tr>
<tr><td><b>Web Site:</b></td><td> $web</td></tr>
<tr><td><b>Facility Type:</b></td><td> $fac_type</td></tr>
<tr><td><b>Recommendation:</b></td><td> ";
If ($rec=="3"{
$msg = $msg."Highly Recommended</td></tr>";
}elseif ($rec=="2"{
$msg = $msg."Recommended</td></tr>";
}elseif ($rec=="1"{
$msg = $msg."Not Recommended</td></tr>";
}
$msg=$msg."
<tr><td><b>Comment:</b></td><td> $comm_comment</td></tr>
</table>
</td></tr>
</table>";
mail($to, $subject, $msg, $mailheaders); //mail function to e-mail the form
// Set the script's max execution time to 300 seconds
set_time_limit(300);
$to = "myemail@mydomain.com"; //The e-mail address to be sent to
$subject = "Submission"; //The subject line of the e-mail
$mailheaders = "From: ".trim($reviewer)."<".trim($rev_email).">\n"; //The users name will appear here
$mailheaders .= "X-Mailer: PHP\n"; //mailer
$mailheaders .= "X-Priority: 1\n"; //1 UrgentMessage, 3 Normal
$mailheaders .= "MIME-Version: 1.0\nContent-Type: text/html; charset=iso-8859-1\nTransport-Encoding: 8bit\n";//Converts text into html for the e-mail message
//$mailheaders .= "Reply-To: myemail@domain.com\n\n"; //a please reply message will display with e-mail address
$msg = "
<style>}
TD { /* set default for text in a table */
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12pt;
vertical-align: top;
}
</style>
<table>
<tr><td>
<table border=1 cellspacing=1 cellpadding=3 >
<tr><td colspan=2 align=center bgcolor='2b4e8e'><font color='ffffff'><b>Your Information</b></font></td></tr>
<tr><td><br><b>Name:</b></td><td><br> $reviewer</td></tr>
<tr><td><b>Company:</b></td><td> $rev_co</td></tr>
<tr><td><b>E-mail:</b></td><td> $rev_email</td></tr>
<tr><td><b>Phone:</b></td><td> $rev_phone</td></tr>
<tr><td colspan=2 align=center bgcolor='2b4e8e'><font color='ffffff'><b>Facility Contact Information</b></font></td></tr>
<tr><td><br><b>Facility Name:</b></td><td><br> $co_name</td></tr>
<tr><td><b>City:</b></td><td> $co_city</td></tr>
<tr><td><b>State:</b></td><td> $co_state</td></tr>
<tr><td><b>Contact Name(s):</b></td><td> $cont_name</td></tr>
<tr><td><b>Contact E-mail(s):</b></td><td> $cont_email</td></tr>
<tr><td><b>Contact Phone Number(s):</b></td><td> $cont_phone</td></tr>
<tr><td><b>Contact Fax Number(s):</b></td><td> $cont_fax</td></tr>
<tr><td><b>Federal ID Number:</b></td><td> $fed_id</td></tr>
<tr><td><b>Web Site:</b></td><td> $web</td></tr>
<tr><td><b>Facility Type:</b></td><td> $fac_type</td></tr>
<tr><td><b>Recommendation:</b></td><td> ";
If ($rec=="3"{
$msg = $msg."Highly Recommended</td></tr>";
}elseif ($rec=="2"{
$msg = $msg."Recommended</td></tr>";
}elseif ($rec=="1"{
$msg = $msg."Not Recommended</td></tr>";
}
$msg=$msg."
<tr><td><b>Comment:</b></td><td> $comm_comment</td></tr>
</table>
</td></tr>
</table>";
mail($to, $subject, $msg, $mailheaders); //mail function to e-mail the form