title: php email, code reuse fails on second include
body: <p>I posted earlier as an email and relocation issue, however after trying several things, and tracing (in production! yech!)
  I have found the culprit - but have NO IDEA why or where to go from here.</p>
  
  <p>you will see in the below code I include 'email.php' twice - because one receipt goes to the user, the other includes some meta data about the user and goes to support...</p>
  
  <p>if i comment out the SECOND include, my redirect works, if i leave it in, it bombs...
  the notify email is valid, and is the only thing that is different.</p>
  
  <p>Im at a loss </p>
  
  <p>PHP FORM PROCESSOR</p>
  
  <pre><code>...
  // send two emails
      $_emailTo = $email; // the email of the person requesting
      $_emailBody = $text_body; // the stock response with things filled in
      include ( 'email.php' );
  
      $_emailTo = $notifyEmail; // the support email address
      $_emailBody = $pretext.$text_body; // pretext added as meta data for support w/ same txt sent to user
  //I make it this far in my trace - then nothing 
       include ( 'email.php' );
  
  // relocate
      echo '&lt;META HTTP-EQUIV="Refresh" Content="0; URL=success.php" &gt;';
      exit;
  </code></pre>
  
  <p>PHP MAILER (email.php)</p>
  
  <pre><code>&lt;?php
      require 'phpmailer/class.phpmailer.php';
  
  //Create a new PHPMailer instance
  $mail = new PHPMailer();
  
  //Tell PHPMailer to use SMTP
  $mail-&gt;IsSMTP();
  
  //Enable SMTP debugging
  // 0 = off (for production use)
  // 1 = client messages
  // 2 = client and server messages
  $mail-&gt;SMTPDebug = 0;
  
  //Set the hostname of the mail server
  $mail-&gt;Host = "mail.validmailserver.com";
  
  //Set the SMTP port number - likely to be 25, 465 or 587
  $mail-&gt;Port = 26;
  
  //Whether to use SMTP authentication
  $mail-&gt;SMTPAuth = true;
  
  //Username to use for SMTP authentication
  $mail-&gt;Username = "validusername";
  
  //Password to use for SMTP authentication
  $mail-&gt;Password = "pass1234";
  
  //Set who the message is to be sent from
  $mail-&gt;SetFrom('me@validmailserver.com', 'no-reply @ this domain');
  
  //Set an alternative reply-to address
  //$mail-&gt;AddReplyTo('no-reply@validmailserver.com','Support');
  
  //Set who the message is to be sent to
  $mail-&gt;AddAddress( $_emailTo );
  $mail-&gt;Subject = $_emailSubject;
  $mail-&gt;MsgHTML( $_emailBody );
  
  $_emailError = false;
  
  //Send the message, check for errors
  if( !$mail -&gt; Send() ) {
      $_emailError = true;
      echo "Mailer Error: " . $mail-&gt;ErrorInfo;
  } 
  ?&gt;
  </code></pre>
  
  <p>help - please</p>