Php email with images not showing in Outllook and Android Gmail -


i sending email php. have 3 images table backgrounds advised do. problem can not see email images when viewing in outlook nad adroid gmail app.

here code used:

$headers = "from:  furniture \r\n"; $headers .= "reply-to: info@furniture.com \r\n"; $headers .= "mime-version: 1.0\r\n"; $headers .= "content-type: text/html; charset=iso-8859-1\r\n";  $message = '<html><body style="margin: 0;">'; $message .= '<table background="http://mysite.com/emailfinal1.jpg" border="0" width="650" height="506" style="font-family: arial, tahoma;color: black; margin: 0;"> <tr height="308" width="650"><td width="450"></td><td></td></tr> <tr height="16" width="650" style="font-size:12px;"><td width="450">&nbsp;</td><td align="left" valign="bottom">'. $first_name . ' ' . $last_name . '</td></tr> <tr height="16" width="650" style="font-size:12px;"><td width="450">&nbsp;</td><td align="left" valign="bottom">'. $email . '</td></tr> <tr height="16" width="650" style="font-size:12px;"><td width="450">&nbsp;</td><td align="left" valign="bottom">'. $nextdate . '</td></tr> <tr height="134" width="650"><td width="450"></td><td></td></tr> </table> <table background="http://mysite.com/emailfinal2.jpg" border="0" width="650" height="133" style="font-family: arial, tahoma;color: #29468a; margin: 0;"> <tr height="10" width="650"><td width="175"></td><td></td></tr> <tr height="123" width="650" style="font-size:13px;"><td width="175">&nbsp;</td><td align="left" valign="baseline"><a href="http://www.mysite.com/unsubscribe.php" target="_blank" style="text-decoration: none;color: #29468a;">unsubscribe</a> | <a href="http://www.mysite.com/terms-and-conditions.aspx" target="_blank" style="text-decoration: none;color: #29468a;">terms & conditions</a></td></tr> </table> <table background="http://mysite.com/emailfinal3.jpg" border="0" width="650" height="60" style="font-family: arial, tahoma;color: #29468a; margin: 0;"> <tr height="20" width="650"><td width="526"></td><td></td></tr> <tr height="40" width="650" style="font-size:11px;"><td width="526">&nbsp;</td><td align="left" valign="baseline"><a href="http://www.mysite.com/contact-us.aspx" target="_blank" style="text-decoration: none;color: #29468a;">contact us</a></td></tr> </table>'; $message .= "</body></html>"; 

any advices? in wrong direction? want make email show images default.

many mail clients default not display images externally linked in email yours are. done security reasons (so if open spam email, doesn't automatically make http requests spammer's site fetch images, allow spammer track me).

most mail clients offer user option load messages afterward, that's not ideal (and lot of users don't bother -- don't usually).

the solution embed images in email itself, part of message. mail clients block external images happily display embedded images. done using specially constructed multi-part message, wouldn't recommend trying built yourself.

if you're not doing (it doesn't are), suggest using decent mailer class phpmailer or swiftmailer instead of raw php mail() function. you'll lot more functionality, including things ability embed images mail. should around problem. (as bonus, make code cleaner , easier work with).


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -