jimmyp3016 Posted July 18, 2006 Share Posted July 18, 2006 Can someone tell me why this doesnt send 2 emails? It will send either message if i email one person, but if i try to send to both people with the different messages i get a 500 internal server error. Any help would be great Thanks! Im bascially getting info from someone. Sending the info to my email and then sending a email to the person that subbmited. [code]<? ob_start(); $user = $_GET['usr']; $email = $_GET['email']; include 'asolead.php'; include 'mail_body.php'; $submit_f_name = $_GET['name']; $submit_email = $_GET['name2']; $submit_phone = $_GET['mail']; if ( ($submit_f_name=="") || ($submit_email=="") || ($submit_phone=="") ) { header("Location:error1.html"); exit; } $from_address = '[email protected]'; $to_address = "$email"; $subject = "$submit_f_name , Thank you for viewing my Website"; header("Location: http://www.mywebsite.com/otherfile.php"); mail ("$to_address", "$subject", "$asolead", "From: [email protected] \nContent-Type: text/plain; charset=iso-8859-1\nContent-Transfer-Encoding: 8bit"); mail ("$submit_email", "$subject", "$mail_body", "From: $to_address \nContent-Type: text/plain; charset=iso-8859-1\nContent-Transfer-Encoding: 8bit"); ?> [/code] Link to comment https://forums.phpfreaks.com/topic/14953-help-sending-2-emails-at-once/ Share on other sites More sharing options...
micah1701 Posted July 18, 2006 Share Posted July 18, 2006 not sure that this is behind your problem, but for startersheader("Location: http://www.mywebsite.com/otherfile.php");your calling this header [b]before[/b] you call the mail() functions.the script is going to forward to that location BEFORE it sends the e-mails. Link to comment https://forums.phpfreaks.com/topic/14953-help-sending-2-emails-at-once/#findComment-60061 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.