Jump to content

Slow processing - Email


tapupartforpres

Recommended Posts

Hello all.  Got a quick question.  I have a form posting to a SQL database.  Form works great, saves to the SQL file fine and quickly.  Now, I added a couple lines at the end of the code to email to a person here in the office the results.  It is working, but very slowly.  Does anyone have any insight on why this is happening?  Thanks

 

// Configuration Settings
$SendFrom =    "Talk to Us <*****@***********.com>";
$SendTo =      "*****@***********.com";
$SubjectLine = "Talk to Us";
$Divider =     "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";

// Build Message Body from Web Form Input
$MsgBody = @gethostbyaddr($_SERVER["REMOTE_ADDR"]) . "\n$Divider\n";
foreach ($_POST as $Field=>$Value)
   $MsgBody .= "$Field: $Value\n";
$MsgBody .= "$Divider\n" . $_SERVER["HTTP_USER_AGENT"] . "\n";
$MsgBody = htmlspecialchars($MsgBody);  //make content safe

// Send E-Mail and Direct Browser to Confirmation Page
mail($SendTo, $SubjectLine, $MsgBody, "From: $SendFrom");
header("Location: $ThanksURL");

Link to comment
https://forums.phpfreaks.com/topic/126763-slow-processing-email/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.