title: Phpmailer sending Blank Emails with AddStringAttachment()
body: <p>I found a lot of answer around <strong>stackoverflow.com</strong> but haven't helped me , so i am forced to ask</p>
  
  <p><strong>Problem:Phpmailer sending  mails but Blank Emails! no body no attachment !</strong></p>
  
  <pre><code>//Create a new PHPMailer instance
  $mail = new PHPMailer();
  
  $mail-&gt;CharSet = 'UTF-8';
  
  $mail-&gt;IsSMTP(); // telling the class to use SMTP
  $mail-&gt;Host       = "ssl://smtp.gmail.com"; // SMTP server
  $mail-&gt;SMTPAuth   = true;                  // enable SMTP authentication
  $mail-&gt;Port       = 465;  // set the SMTP port for the GMAIL server; 465 for ssl and 587 for tls
  $mail-&gt;Username   = "services@domain.xxx"; // Gmail account username
  $mail-&gt;Password   = "pwd";        // Gmail account password
  
  
  //$mail-&gt;Mailer = 'smtp';
  //Set who the message is to be sent from
  $mail-&gt;SetFrom(service_mail_d, 'XXXX Services');
  //Set an alternative reply-to address
  $mail-&gt;AddReplyTo(service_mail_d, 'XXXX Services');
  //Set who the message is to be sent to
  $mail-&gt;AddAddress("testcenter@xxxx.xxxxx", "Client1");
  //Set the subject line
  $mail-&gt;Subject = "service_order_subject" ;
  //Read an HTML message body from an external file, convert referenced images to embedded,convert HTML into a basic plain-text alternative body
  $mail-&gt;MsgHTML("&lt;h1&gt;Simple TEST&lt;/h1&gt;");
  $mail-&gt;AddStringAttachment($generator_file_content,$generatorId ."html",'UTF-8','text/html');
   //Send the message, check for errors
  $mailSend=$mail-&gt;Send();
  </code></pre>
  
  <p><strong>Update:</strong></p>
  
  <blockquote>
    <p>its sending mail and MsgBody can be seen if no StringAttachment is added !</p>
  </blockquote>