title: Adding Form Data into html file being emailed using phpmailer
body: <p>Hi guys, i have a very basic php issue about adding form data into html/php file being sent using phpmailer</p>
  
  <p>Im using gmail account SMTP to send HTML email on successful submission of form.</p>
  
  <p>On Form submission the HTML email is being successfully sent.</p>
  
  <p>PROBLEM / ISSUE: </p>
  
  <p>Im unable to attach the FORM DATA inputted into various headers in the HTML file that im sending as email.</p>
  
  <p>THIS IS THE CODE OF PHP CALLED : for FORM SUBMISSION. email-content.php is the file that is successfully sent as HTML email using Gmail SMTP.</p>
  
  <pre><code>&lt;?php
  
  
  $salutation = $_POST['salutation'] ;
  $name = $_POST['name'] ;
  //
  $dateDOB = $_POST['DOB_Day'] ;
  $monthDOB = $_POST['DOB_Month'] ;
  $yearDOB = $_POST['DOB_Year'] ;
  //
  $mobileLandline1 = $_POST['mobileLandline1'] ;
  $mobileLandline2 = $_POST['mobileLandline2'] ;
  $mobileLandline3 = $_POST['mobileLandline3'] ;
  $mobileLandline4 = $_POST['mobileLandline4'] ;
  $mobileLandline5 = $_POST['mobileLandline5'] ;
  $mobileLandline6 = $_POST['mobileLandline6'] ;
  $mobileLandline7 = $_POST['mobileLandline7'] ;
  $mobileLandline8 = $_POST['mobileLandline8'] ;
  //
  $language = $_POST['language'] ;
  //
  $address = $_POST['address'] ;
  $city = $_POST['city'] ;
  $state = $_POST['state'] ;
  $pin = $_POST['pin'] ;
  //
  $fax = $_POST['fax'] ;
  $email = $_POST['email'] ;
  //
  $passwordOption = $_POST['passwordOption'] ;
  $passwordOptionProvided = $_POST['passwordOptionProvided'] ;
  
  
  //Using PHPMailer with GMAIL
  
  include("class.phpmailer.php");
  include("class.smtp.php"); // note, this is optional - gets called from main class  if     not already loaded
  
  $mail             = new PHPMailer();
  
  $body             = $mail-&gt;getFile('email-content.php');
  $body             = eregi_replace("[\]",'',$body);
  
  $mail-&gt;IsSMTP();
  $mail-&gt;SMTPAuth   = true;                  // enable SMTP authentication
  $mail-&gt;SMTPSecure = "ssl";                 // sets the prefix to the servier
  $mail-&gt;Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server
  $mail-&gt;Port       = 465;                   // set the SMTP port
  
  $mail-&gt;Username   = "####@gmail.com";  // GMAIL username
  $mail-&gt;Password   = "#######";            // GMAIL password
  
  $mail-&gt;From       = "subscriptionForm@abc.com";
  $mail-&gt;FromName   = "Subscrition Form";
  $mail-&gt;Subject    = "SUBSCRIPTION FORM DETAILS FROM WEBSITE";
  $mail-&gt;AltBody    = "This is the body when user views in plain text format";   //Text     Body
  $mail-&gt;WordWrap   = 50; // set word wrap
  
  $mail-&gt;MsgHTML($body);
  
  $mail-&gt;AddReplyTo("replyto@yourdomain.com","Webmaster, ####.com");
  
  $mail-&gt;AddEmbeddedImage('logo.png', 'logo');
  //$mail-&gt;AddAttachment("/path/to/file.zip");             // attachment
  //$mail-&gt;AddAttachment("/path/to/image.jpg", "new.jpg"); // attachment
  
  $mail-&gt;AddAddress("contact@abcd.com","Subscription Form");
  
  $mail-&gt;IsHTML(true); // send as HTML
  
  
  if(!$mail-&gt;Send()) {
   header('Location: http://www.#####.com/subscription-form-fail.html');
  } else {
  //echo "Message has been sent";
  // header('Location: $submissionsuccess');
   header('Location: http://www.####.com/subscription-form-success.html');
  }
  
  ?&gt;
  </code></pre>
  
  <p>THE CODE OF email-content.php : (part ho im calling php data value into HTML template)</p>
  
  <pre><code> &lt;table width="590" border="0" cellspacing="0" cellpadding="0" &gt;
   &lt;tr&gt;
   &lt;td align="left" valign="top" width="50" style="font-size:10pt; font-family:Tahoma, Geneva, sans-serif; padding:2px;"&gt;Name :&lt;/td&gt;
  
   &lt;td align="left"  valign="top"  width="30" style="font-size:10pt; font-family:Tahoma, Geneva, sans-serif; padding:2px;"&gt;&lt;?php $salutation ?&gt;&lt;/td&gt;
   &lt;td align="left" valign="top" width="460" style="font-size:10pt; font-family:Tahoma, Geneva, sans-serif;"&gt;
   &lt;table width="460" border="1" cellspacing="0" cellpadding="0" style=" border-collapse:collapse;font-size:10pt; font-family:Tahoma, Geneva, sans-serif;border:1px solid #e0e3e5;" &gt;
   &lt;tr&gt;
   &lt;td style="padding:2px;"&gt;&lt;?php $_POST['name'] ?&gt;&lt;/td&gt;
   &lt;/tr&gt;
   &lt;/table&gt;
  </code></pre>
  
  <p></p>
  
  <p>Im a novice in php programming and im sure im missing something very basic here. The name values submited are NOT visible in the HTML email sent.</p>
  
  <p>Any guidance in this matter shall be highly appreciated</p>
  
  <p>Thanks</p>
  
  <p>Moody</p>