title: Email sent using PHPmalier Class image break in gmail, hotmail, yahoo
body: <p>Hope you all are fine.</p>
  
  <p>I am facing a very irritating problem using PHPmailer class. When I sent email everything is fine but some images in the email body are break <strong>%0D+</strong> sign is embedded into URL on <strong>Gmail</strong> and space is added on <strong>Yahoo</strong> and <strong>Hotmail</strong> for the same images.</p>
  
  <p>I don't know why when I print email on the browser it is perfectly fine but on the email, it is not.</p>
  
  <p><strong>Browser View</strong> When I print email before sending.
  <a href="https://i.stack.imgur.com/3bIYW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3bIYW.png" alt="enter image description here"></a></p>
  
  <p><strong>Gmail View</strong> after sending the email.</p>
  
  <p><a href="https://i.stack.imgur.com/UglWP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UglWP.png" alt="enter image description here"></a></p>
  
  <p><strong>Here is the code of email body</strong></p>
  
  <pre><code>$bodyEmail  =   '&lt;body style="background: #eee;"&gt;
                      &lt;table cellpadding="5"  bgcolor="#fff" style="margin:0 auto;"&gt;
                          &lt;tr&gt;
                              &lt;td&gt;
                                  &lt;table style="width: 100%;  max-width: 700px; background-color: #FFF; margin:0 auto; " cellpadding="5"&gt;
                                      &lt;tr style="margin-top:10px; margin-bottom:10px;"&gt;
                                          &lt;td align="center" style="margin-bottom:20px"&gt;&lt;img src="http://fwt-logi.com/new_fwt/newsite/images/logo-fwt-logistic.png" /&gt;&lt;/td&gt;
                                      &lt;/tr&gt;
                                      &lt;tr class=""&gt;
                                          &lt;td style="font-size:24px; font-weight:bold; color: #fff;  text-align:center; background-color:#173385;  font-family:Arial, Helvetica, sans-serif; "&gt;Logistic Services for Small and Large Companies&lt;/td&gt;
                                      &lt;/tr&gt;
                                      &lt;tr style="margin-bottom:10px; margin-top:20px;"&gt;
                                          &lt;td  style="font-size:24px; font-weight:bold; font-family:Arial, Helvetica, sans-serif; margin-bottom:10px;  font-family: Arial, Helvetica, sans-serif;" colspan="2"&gt;&lt;strong&gt;Dear : FWT LOGISTICS(TRS)&lt;/strong&gt;&lt;/td&gt;
                                      &lt;/tr&gt;
                                  &lt;/table&gt;
                                  &lt;table border="1" style="width:100%; max-width:700px; background-color: #FFF; margin:0 auto; border-collapse:collapse; border:1px solid #ccc;" cellpadding="5"  cellspacing="0"&gt;
                                      &lt;tr&gt;
                                          &lt;td width="50%" style="color: #173385; font-size:20px; font-family: Arial, Helvetica, sans-serif; border:1px solid #ccc;"&gt;&lt;strong&gt;Chassis No. &lt;/strong&gt;&lt;/td&gt;
                                          &lt;td style="font-size:20px; font-family: Arial, Helvetica, sans-serif;  border:1px solid #ccc;"&gt;'.$imagesRow['chassis_no'].'&lt;/td&gt;
                                      &lt;/tr&gt;
                                      &lt;tr&gt;
                                          &lt;td width="50%" style="color: #173385; font-size:20px; font-family: Arial, Helvetica, sans-serif; border:1px solid #ccc;"&gt;&lt;strong&gt;Make&lt;/strong&gt;&lt;/td&gt;
                                          &lt;td style="font-size:20px; font-family: Arial, Helvetica, sans-serif;  border:1px solid #ccc;"&gt;'.$arr_mk[$imagesRow['make_id']].'&lt;/td&gt;
                                      &lt;/tr&gt;
                                      &lt;tr&gt;
                                          &lt;td width="50%" style="color: #173385; font-size:20px; font-family: Arial, Helvetica, sans-serif;border:1px solid #ccc;"&gt;&lt;strong&gt;Model&lt;/strong&gt;&lt;/td&gt;
                                          &lt;td style="font-size:20px; font-family: Arial, Helvetica, sans-serif; border:1px solid #ccc;" &gt;'.$arr_nm[$imagesRow['name_id']].'&lt;/td&gt;
                                      &lt;/tr&gt;
                                      &lt;tr&gt;
                                          &lt;td width="50%" style="color: #173385; font-size:20px; font-family: Arial, Helvetica, sans-serif;border:1px solid #ccc;"&gt;&lt;strong&gt;Engine No. &lt;/strong&gt;&lt;/td&gt;
                                          &lt;td style="font-size:20px; font-family: Arial, Helvetica, sans-serif; border:1px solid #ccc;"'.$imagesRow['engine_no'].'&gt;&lt;/td&gt;
                                      &lt;/tr&gt;
                                  &lt;/table&gt;
                                  &lt;table style="width: 100%;  max-width: 700px;background-color: #FFF; margin:20px 0px; margin:0 auto;  padding:10px; margin:0 auto;"&gt;
                                      &lt;tr&gt;
                                          &lt;td bordercolor="333" align="center"&gt;&lt;a href="'.SS_URL.'services/zip.php?chassis_no='.$imagesRow['chassis_no'].'"&gt;&lt;img src="'.SS_IMG.'download-img.png" alt="Click here and download images" /&gt;&lt;/a&gt;&lt;/td&gt;
                                      &lt;/tr&gt;
                                  &lt;/table&gt;
  
                                  &lt;table style="margin-top:15px 0px; width: 100%; max-width: 700px;background-color: #FFF; margin:0 auto;" cellpadding="5"&gt;
                                      &lt;tr&gt;';
                                          $i  =   '';
                                          foreach($allImages as $imgName){
                                              $bodyEmail  .=  '&lt;td style="margin-top:20px; width:20%; padding:5px;"&gt;&lt;img width="100%" src="'.$imagesURL.$imgName.'"/&gt;&lt;/td&gt;';
                                              $i++;
                                              if($i%5==0){
                                                  $bodyEmail  .=  "&lt;/tr&gt;&lt;tr&gt;";
                                              }
                                          }
                              $bodyEmail  .=  '&lt;/tr&gt;
                                  &lt;/table&gt;
                                  &lt;table  style="width: 100%; max-width: 700px;background-color: #FFF; border-top:3px solid #333; margin-top:20px; margin-bottom:20px; font-family:Arial, Helvetica, sans-serif;   margin:0 auto;" cellspacing="0" cellpadding=""&gt;
                                  &lt;tr&gt;
                                      &lt;td&gt;
                                          &lt;table&gt;
                                              &lt;tr&gt;
                                                  &lt;td colspan="2"&gt;If you have any questions please use JFA Direct Line.&lt;/td&gt;
                                              &lt;/tr&gt;
                                              &lt;tr&gt;
                                                  &lt;td colspan="2"&gt;&lt;strong&gt;Kobe&lt;/strong&gt;&lt;/td&gt;
                                              &lt;/tr&gt;
                                              &lt;tr&gt;
                                                  &lt;td style="color: #173385; "&gt;&lt;strong&gt;Quality Control&lt;/strong&gt;&lt;/td&gt;
                                                  &lt;td&gt;&lt;i class="fa fa-ph"&gt;&lt;/i&gt;080-6974-0670&lt;/td&gt;
                                              &lt;/tr&gt;
                                              &lt;tr&gt;
                                                  &lt;td style="color: #173385;" &gt;&lt;strong&gt;Inspector&lt;/strong&gt;&lt;/td&gt;
                                                  &lt;td&gt;&lt;i class="fa fa-ph"&gt;&lt;/i&gt;080-6974-0670&lt;/td&gt;
                                              &lt;/tr&gt;
                                          &lt;/table&gt;
                                      &lt;/td&gt;
                                      &lt;td&gt;
                                          &lt;table&gt;
                                              &lt;tr&gt;
                                                  &lt;td colspan="2"&gt;(Sales Manager: Osamu Nishihara 080-6172-0680)&lt;/td&gt;
                                              &lt;/tr&gt;
                                              &lt;tr&gt;
                                                  &lt;td colspan="2"&gt;&lt;strong&gt;Tokyo Bay&lt;/strong&gt;&lt;/td&gt;
                                              &lt;/tr&gt;
                                              &lt;tr&gt;
                                                  &lt;td style="color: #173385; "&gt;&lt;strong&gt;Quality Control&lt;/strong&gt;&lt;/td&gt;
                                                  &lt;td&gt;&lt;i class="fa fa-ph"&gt;&lt;/i&gt;080-6974-0671&lt;/td&gt;
                                              &lt;/tr&gt;
                                              &lt;tr&gt;
                                                  &lt;td style="color: #173385; " &gt;&lt;strong&gt;Inspector&lt;/strong&gt;&lt;/td&gt;
                                                  &lt;td&gt;&lt;i class="fa fa-ph"&gt;&lt;/i&gt;080-6974-0672&lt;/td&gt;
                                              &lt;/tr&gt;
                                          &lt;/table&gt;
                                      &lt;/td&gt;
                                  &lt;/tr&gt;
                              &lt;/table&gt;
                              &lt;/td&gt;
                          &lt;/tr&gt;
                      &lt;/table&gt;&lt;/body&gt;';
  </code></pre>
  
  <p>Problem in this loop can you please tell me where i am wrong?</p>
  
  <pre><code>&lt;table style="margin-top:15px 0px; width: 100%; max-width: 700px;background-color: #FFF; margin:0 auto;" cellpadding="5"&gt;
                                      &lt;tr&gt;';
                                          $i  =   '';
                                          foreach($allImages as $imgName){
                                              $bodyEmail  .=  '&lt;td style="margin-top:20px; width:20%; padding:5px;"&gt;&lt;img width="100%" src="'.$imagesURL.$imgName.'"/&gt;&lt;/td&gt;';
                                              $i++;
                                              if($i%5==0){
                                                  $bodyEmail  .=  "&lt;/tr&gt;&lt;tr&gt;";
                                              }
                                          }
                              $bodyEmail  .=  '&lt;/tr&gt;
                                  &lt;/table&gt;
  </code></pre>
  
  <p><strong>Gmail OUT PUT code</strong></p>
  
  <pre><code>&lt;tr&gt;
              &lt;td&gt;&lt;img width="100px" src="https://ci6.googleusercontent.com/proxy/pKuau8twpVJ61cLvY1g-nQahBHu7lqUm3NwyA-Z-0fxf_ASZlK6SvHTFiRbot11r1AGDahiuhKcNyidOjGAH0bYdIGUV2Uvdq6nJJyBGM_4KM4H5ZXxWytT4_yfFq7c0vCM=s0-d-e1-ft#http://fwt-logi.com/uploaded_files/image/thumb/1175065_21_115_1528884248.jpg" class="CToWUd"&gt;&lt;/td&gt;
              &lt;td&gt;&lt;img width="100px" src="https://ci5.googleusercontent.com/proxy/e9Geo989EDQoLjtN72wDFDHRVnq6q8agHfx_Fzi188L0dv2YXeAJjDg8_IvmbdzMwemWT4-1ee-cHSCjqPJ2iSrTUrr3bhAIcpYgoCSxso8t-kX0ubA5bUfYLg5ap1iDwyg=s0-d-e1-ft#http://fwt-logi.com/uploaded_files/image/thumb/1175065_20_786_1528884248.jpg" class="CToWUd"&gt;&lt;/td&gt;
              &lt;td&gt;&lt;img width="100px" src="https://ci4.googleusercontent.com/proxy/ZVXoQ0-s5xQXJ6J7WHXHhH9U0iBCfcUVe2YnyW46ouRj-gXpeWPSQ0HScQ5PL0P-aHg_xNbf1dL3f3lE18fqAB-Trfd20xpmztWwuEN3OLitxc0u4d1p4aAIqN3TInUP-hoH8X9B=s0-d-e1-ft#http://fwt-logi.com/uploaded_files/im%0D+age/thumb/1175065_15_715_1528884247.jpg" class="CToWUd"&gt;&lt;/td&gt;
              &lt;td&gt;&lt;img width="100px" src="https://ci5.googleusercontent.com/proxy/PZFG0lssYX5QeqQQPVqqCjjsguHN4gu6Cspp_qy-kQ7PrkTHjYpeJzDiggAnalLCsQkAkKF8IR6O7cZUXc53yeGtGjVAwnZIXPnM3GMEo6zKcKdvW1xXmsamm0kotWy1Frs=s0-d-e1-ft#http://fwt-logi.com/uploaded_files/image/thumb/1175065_16_600_1528884247.jpg" class="CToWUd"&gt;&lt;/td&gt;
              &lt;td&gt;&lt;img width="100px" src="https://ci3.googleusercontent.com/proxy/aPH9AMu4mds0NE0cFRjF_jGboAAjwzqKArbrXmHYJv8G9LdMnaR2Gml-92Q3ldfXOhoaYECuuMJWZaZlqMz7d5gKQsbITNjKo5As37-pMC0JLn0nwsIcDznPJLRF9CWy0Ps=s0-d-e1-ft#http://fwt-logi.com/uploaded_files/image/thumb/1175065_18_449_1528884248.jpg" class="CToWUd"&gt;&lt;/td&gt;
              &lt;td&gt;&lt;img width="100px" src="https://ci5.googleusercontent.com/proxy/7dWlo34WF6FoNIZSNN3noBko4yfEDiBvalgBFelcYQaQ84WQrfxaP_3eSUvXz2ssAe7P7uDi7L0Y2qUFQFKO-FZ58Ltuf1p5azscisXVe2ZNogjHh_avbNLhUtloeG2jWQ=s0-d-e1-ft#http://fwt-logi.com/uploaded_files/image/thumb/1175065_8_820_1528884247.jpg" class="CToWUd"&gt;&lt;/td&gt;
          &lt;/tr&gt;
  </code></pre>