Reputation: 5986
When I create an email and send an image in the body of the email, most email clients make you click "Load all images" I want this to load automatically like a regular email would from any other company. Like an html email. This image is hosted on an external website, and is around 500kb-1.5mb and around 900x1200 size. How can I accomplish this? Is it just a header issue?
$from = "";
$headers = "From:" . $from ."\r\n";
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$to = "";
$subject = "";
$subject = html_entity_decode($subject, ENT_QUOTES, 'UTF-8');
$message = '<html><head>';
$message .='</head><body>';
$message .='<img src="http://i45.tinypic.com/2qjkb2u.jpg"/>';
$message .= '</body></html>';
mail($to,$subject,$message,$headers);
Upvotes: 0
Views: 691
Reputation: 219884
You can't enforce this as it is not within your control. Email clients don't load images by default to protect the privacy of their users. (Spammers can track email addresses using images. The image is loaded via a server side script which confirms the email was received and viewed. Then spammers know the email address is valid and active). That's why it takes an active action by the user to actually view the images in the email.
Upvotes: 2