Sending HTML emails using PHPMailer with TinyMCE inline images
<p>Please help! I have been trying to figure this out for days and I am unable to. I am trying to send HTML emails using PHPMailer. To include/insert inline images, I use TinyMCE's plugin <a href="http://www.responsivefilemanager.com/" rel="nofollow">Responsive FileManager</a>. The email sends successfully and displays HTML but the problem is, the images within TinyMCE Editor are not getting displayed. </p>

<p>Below is a screenshot of the test email I received with an inline-image within TinyMCE Editor.</p>

<p><a href="https://i.stack.imgur.com/lcHvh.png" rel="nofollow"><img src="https://i.stack.imgur.com/lcHvh.png" alt="enter image description here"></a></p>

<p>Below is the form code:</p>

<pre><code>&lt;head&gt;
&lt;script src="../js/tinymce/tinymce.min.js"&gt;&lt;/script&gt;
&lt;script language="javascript" type="text/javascript"&gt;
tinymce.init({ 
    selector:'textarea', 
    menubar: false,
    height: '300px',
    themes: 'modern',
    plugins: [
    'advlist autolink lists link image charmap print preview hr anchor pagebreak',
    'searchreplace wordcount visualblocks visualchars code fullscreen',
    'insertdatetime media nonbreaking save table contextmenu directionality',
    'emoticons template paste textcolor colorpicker textpattern imagetools responsivefilemanager'],
    toolbar: ['undo redo | styleselect | bold italic | forecolor backcolor | imageupload responsivefilemanager',
    'alignleft aligncenter alignright | bullist numlist | outdent indent | table | preview'],     

    external_filemanager_path:'/responsivefilemanager/filemanager/',
    filemanager_title:'Responsive Filemanager',
    external_plugins: { 'filemanager' : '/responsivefilemanager/filemanager/plugin.min.js'}
}); 
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form action="CascadeFunction.php" method="post" name="cascader" id="cascader" enctype="multipart/form-data"&gt;
         &lt;label for="details"&gt;&lt;span class="required"&gt;*&lt;/span&gt;DETAILS&lt;/label&gt;
            &lt;textarea name="details" cols="70%" rows="10" id="details"&gt;&lt;/textarea&gt;
         &lt;input class="btn btn-primary" name="Submit" type="submit" id="submit" value="POST &amp;amp; CASCADE" /&gt;
    &lt;/form&gt;
&lt;/body&gt;
</code></pre>

<p>Below is my code to process the email (CascadeFunction.php).</p>

<pre><code>require_once('../PHPMailer_5.2.1/class.phpmailer.php');
$mail = new PHPMailer();
$subject = "CASCADE: Test Subject Cascade"; 
$msgbody = $upload_name;        
$mail-&gt;Subject = "$subject";
$mail-&gt;IsHTML(true); // This tells the PhPMailer that the messages uses HTML.
$mail-&gt;MsgHTML(str_replace(
    array(
        '%Audience%',
        '%Category%',
        '%Title%',
        '%Type%',
        '%quickDescr%',
        '%details%'
    ), 
    array(
        $Audience,
        $Category,
        $Title,
        $Type,
        $QuickDescr,
        $CascadeDetails
    ), file_get_contents('emailtemplates/email.php')), dirname(__FILE__));
$mail-&gt;AddEmbeddedImage('images/LogoWhiteBG.png', 'logo');
</code></pre>

<p><strong>NOTE:</strong> the <code>$mail-&gt;AddEmbeddedImage</code>, image displays correctly on emails. Only those images within the TinyMCE editor are displayed as broken.</p>