$pageTitle = 'Ed Slott and Company\'s Monthly IRA Updates - December 2012'; $subject = "FW: " . $pageTitle; $includeFilename = dirname(__FILE__) . '/dadamail.html'; $error = false; $from_error = false; $from_email_error = false; $to_error = false; $email_error = array('1' => false, '2' => false, '3' => false, '4' => false, '5' => false); $name_error = array('1' => false, '2' => false, '3' => false, '4' => false, '5' => false); if (isset($_POST['send_email'])) { $_GET['from_email'] = $_POST['from_email']; if ($_POST['from_name'] == "") { $from_error = true; } if (($_POST['from_email'] == "") || eregi('^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$', $_POST['from_email']) == false) { $from_email_error = true; } for ($i = 1; $i <= 5; $i++) { $name_ind = 'to_name_' . $i; $email_ind = 'to_email_' . $i; if ($_POST[$name_ind] == "") { if ($i == 1) { $name_error[$i] = true; $to_error = true; } else { if ($_POST[$email_ind] != "") { $name_error[$i] = true; $to_error = true; } } } if (($_POST[$email_ind] == "") || eregi('^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$', $_POST[$email_ind]) == false) { if ($_POST[$name_ind] == "" && $_POST[$email_ind] == "" && $i != 1) { //do nothing } else { $email_error[$i] = true; $error = true; } } } } ?>
Forward to a Friend |
Fill in the boxes below to send a personalized copy of this email to your friend(s). There were problems with your form submission. Problems are shown in red below each field. ' . "\n"; //$headers .= "From: Patrick Wherry ' . $_POST['from_name'] . " has forwarded this email to you"; if ($_POST['email_message'] != "") { $message_info .= " with the following message: " . nl2br($_POST['email_message']) . " "; $sent_str_message = " with the following mesage: " . $_POST['email_message'] . " "; } else { $message_info .= ". "; $sent_str_message = " "; } ob_start(); include( $includeFilename ); $message_head = ob_get_clean(); $message_end = ''; $sent_str = " The email has been forwarded to: "; for ($i = 1; $i <= 5; $i++) { $to_str_email = 'to_email_' . $i; $to_str_name = 'to_name_' . $i; if ($_POST[$to_str_email] != "") { $e_message = $message_info . $message_head . $message_body .$message_end; $sent_str .= " " . $_POST[$to_str_email]; //print ""; mail($_POST[$to_str_email], $subject, $e_message, $headers); } } print '' . $sent_str . $sent_str_message; ?> The information entered above will only be used to email this page on your behalf and will not be used for any other purpose. |