tapupartforpres Posted October 2, 2008 Share Posted October 2, 2008 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 More sharing options...
sh0wtym3 Posted October 2, 2008 Share Posted October 2, 2008 What do you mean by it is working "slowly"? Does the form take a while to send after you hit submit, or does the e-mail take a while to arrive in your co-workers inbox? Link to comment https://forums.phpfreaks.com/topic/126763-slow-processing-email/#findComment-655664 Share on other sites More sharing options...
JonnoTheDev Posted October 2, 2008 Share Posted October 2, 2008 This could be a DNS issue. Does your server resolve names properly? If you take out the email part of the script so its just the database insert does the script run quickly? Link to comment https://forums.phpfreaks.com/topic/126763-slow-processing-email/#findComment-655683 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.