Надеюсь, у вас все хорошо.
Я столкнулся с очень раздражающей проблемой при использовании класса PHPmailer. Когда я отправляю электронное письмо, все в порядке, но некоторые изображения в теле письма прерываются % 0D + знак встраивается в URL на Gmail , а пространство добавляется на Yahoo и Hotmail для тех же изображений.
Я не знаю, почему, когда я печатаю электронную почту в браузере, это совершенно нормально, а в электронной почте - нет.
Просмотр в браузере Когда я печатаю электронную почту перед отправкой.
Gmail View после отправки электронного письма.
Вот код тела письма
$bodyEmail = '<body style="background: #eee;">
<table cellpadding="5" bgcolor="#fff" style="margin:0 auto;">
<tr>
<td>
<table style="width: 100%; max-width: 700px; background-color: #FFF; margin:0 auto; " cellpadding="5">
<tr style="margin-top:10px; margin-bottom:10px;">
<td align="center" style="margin-bottom:20px"><img src="http://fwt-logi.com/new_fwt/newsite/images/logo-fwt-logistic.png" /></td>
</tr>
<tr class="">
<td style="font-size:24px; font-weight:bold; color: #fff; text-align:center; background-color:#173385; font-family:Arial, Helvetica, sans-serif; ">Logistic Services for Small and Large Companies</td>
</tr>
<tr style="margin-bottom:10px; margin-top:20px;">
<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"><strong>Dear : FWT LOGISTICS(TRS)</strong></td>
</tr>
</table>
<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">
<tr>
<td width="50%" style="color: #173385; font-size:20px; font-family: Arial, Helvetica, sans-serif; border:1px solid #ccc;"><strong>Chassis No. </strong></td>
<td style="font-size:20px; font-family: Arial, Helvetica, sans-serif; border:1px solid #ccc;">'.$imagesRow['chassis_no'].'</td>
</tr>
<tr>
<td width="50%" style="color: #173385; font-size:20px; font-family: Arial, Helvetica, sans-serif; border:1px solid #ccc;"><strong>Make</strong></td>
<td style="font-size:20px; font-family: Arial, Helvetica, sans-serif; border:1px solid #ccc;">'.$arr_mk[$imagesRow['make_id']].'</td>
</tr>
<tr>
<td width="50%" style="color: #173385; font-size:20px; font-family: Arial, Helvetica, sans-serif;border:1px solid #ccc;"><strong>Model</strong></td>
<td style="font-size:20px; font-family: Arial, Helvetica, sans-serif; border:1px solid #ccc;" >'.$arr_nm[$imagesRow['name_id']].'</td>
</tr>
<tr>
<td width="50%" style="color: #173385; font-size:20px; font-family: Arial, Helvetica, sans-serif;border:1px solid #ccc;"><strong>Engine No. </strong></td>
<td style="font-size:20px; font-family: Arial, Helvetica, sans-serif; border:1px solid #ccc;"'.$imagesRow['engine_no'].'></td>
</tr>
</table>
<table style="width: 100%; max-width: 700px;background-color: #FFF; margin:20px 0px; margin:0 auto; padding:10px; margin:0 auto;">
<tr>
<td bordercolor="333" align="center"><a href="'.SS_URL.'services/zip.php?chassis_no='.$imagesRow['chassis_no'].'"><img src="'.SS_IMG.'download-img.png" alt="Click here and download images" /></a></td>
</tr>
</table>
<table style="margin-top:15px 0px; width: 100%; max-width: 700px;background-color: #FFF; margin:0 auto;" cellpadding="5">
<tr>';
$i = '';
foreach($allImages as $imgName){
$bodyEmail .= '<td style="margin-top:20px; width:20%; padding:5px;"><img width="100%" src="'.$imagesURL.$imgName.'"/></td>';
$i++;
if($i%5==0){
$bodyEmail .= "</tr><tr>";
}
}
$bodyEmail .= '</tr>
</table>
<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="">
<tr>
<td>
<table>
<tr>
<td colspan="2">If you have any questions please use JFA Direct Line.</td>
</tr>
<tr>
<td colspan="2"><strong>Kobe</strong></td>
</tr>
<tr>
<td style="color: #173385; "><strong>Quality Control</strong></td>
<td><i class="fa fa-ph"></i>080-6974-0670</td>
</tr>
<tr>
<td style="color: #173385;" ><strong>Inspector</strong></td>
<td><i class="fa fa-ph"></i>080-6974-0670</td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td colspan="2">(Sales Manager: Osamu Nishihara 080-6172-0680)</td>
</tr>
<tr>
<td colspan="2"><strong>Tokyo Bay</strong></td>
</tr>
<tr>
<td style="color: #173385; "><strong>Quality Control</strong></td>
<td><i class="fa fa-ph"></i>080-6974-0671</td>
</tr>
<tr>
<td style="color: #173385; " ><strong>Inspector</strong></td>
<td><i class="fa fa-ph"></i>080-6974-0672</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table></body>';
Проблема в этом цикле, скажите, пожалуйста, где я не прав?
<table style="margin-top:15px 0px; width: 100%; max-width: 700px;background-color: #FFF; margin:0 auto;" cellpadding="5">
<tr>';
$i = '';
foreach($allImages as $imgName){
$bodyEmail .= '<td style="margin-top:20px; width:20%; padding:5px;"><img width="100%" src="'.$imagesURL.$imgName.'"/></td>';
$i++;
if($i%5==0){
$bodyEmail .= "</tr><tr>";
}
}
$bodyEmail .= '</tr>
</table>
GUT OUT PUT код
<tr>
<td><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"></td>
<td><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"></td>
<td><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"></td>
<td><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"></td>
<td><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"></td>
<td><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"></td>
</tr>