Support issue leads to fix and new feature

<p>Posting support issues to the "Tickets" on Sourceforge is that it puts a structure to support request and possible fixes.&nbsp;</p><p>The support issue I am talking about is one where a user was reporting bad display on certain email clients when using PHPMailer Pro to send an email with an attachment.&nbsp;</p><p>Without the attachment, no problems.</p><p>With the attachment, error. The method $mail-&gt;AddAttachment('filename.png'); generated the error.</p><p>The user did offer that when he switched and used the method&nbsp;<span style="font-style: normal; font-weight: 400; text-align: inherit;">$mail-&gt;AddEmbeddedimage('filename.png','my-attach'); -- all worked well.</span></p><p>As an aside, I am aware that there are errors generated on some systems ... those are a result of server upgrades where the server actually breaks the RFC specification for header line endings. The server fix will report an error when CR + LF is used (as in the RFC specification) and will not report an error when only LF is used.&nbsp;</p><p>The error reported by the user appeared (from the uploaded results screen shot) as the same.&nbsp;</p><p>I had not achieved a fix for this yet, so I went to work to resolve this issue. I did resolve that. After posting a fix and offering a temporary version of PHPMailer Pro to the user for testing, I re-read the support posts. I had made an incorrect assumption.</p><p>I thought the user was working the method AddEmbeddedImage as a work around to the error. It wasn't a work around, that was how the email was supposed to be structured. The error was the first attempt, using the method AddAttachment.&nbsp;</p><p>There really wasn't an error in the first place.</p><p>However, I did get to fix the other issue, that is server upgrades breaking the RFC specification for header line endings.&nbsp;</p><p>At the same time, I noticed there is no error checking in any version of PHPMailer, PHPMailer Pro, PHPMailer Lite, or the new PHPMailer Mini for duplicate images or duplicate attachments. (Note: PHPMailer Mini will not support inline graphics).</p><p>So, I solved that issue too and it will be in the next version of PHPMailer Pro, PHPMailer Lite, and the upcoming PHPMailer Mini.</p><p>Over the years, one of the feature requests has been to provide the ability to have an inline (or embedded) image also to be downloadable (as an attachment). <b>So, I solved that. And it's easy to implement with a slight modification to the method.</b></p><p>I'll post how to do it here, but this is the long version and it can be shortened to one single line.</p><pre><code>$path = "images/error_message_sample.png";<br> $cid = "error-image";<br> $name = "";<br> $encoding = "";<br> $type = "";<br> $attach = "error_message_sample_alt.png";<br> $mail-&gt;AddEmbeddedImage($path, $cid, $name, $encoding, $type, $attach);</code></pre> <p>Looking at it as one single line:</p><pre><code>$mail-&gt;AddEmbeddedImage("images/error_message_sample.png", "error-image", "", "", "", "error_message_sample_alt.png");</code></pre><p>It works perfectly on all the email clients tested so far. Testing, however, continues. Watch for it in the next release of PHPMailer Pro and PHPMailer Lite, with portions implemented in PHPMailer Mini.</p>

Add a comment