osCommerce在电子邮件中嵌入图像

时间:2011-05-12 10:20:54

标签: oscommerce

以下脚本未在电子邮件中嵌入图片。相反,它会删除img标记的src属性:

 require('includes/application_top.php');
//include(DIR_WS_CLASSES . 'mail.php');
$img_url ='<div style="border:1px solid black; padding:5px;"><img src="http://spottheball.designers99.com/images/logo.png" /></div>';
$contents = $img_url;

$contents .= '<div style="padding:4px; border:1px solid red; background:green;font-size:50px">A test text</div>';
$m = new email(array('X-Mailer: osCommerce Mailer'));
$m->add_html($contents);
$m->image_types = 'png';
//$m->headers[] = "Content-Type: image/png";
$m->build_message();
$add_to = 'horizontechnalogies@gmail.com';
$m->send('Shahid', $add_to, 'Omar', 'spottheball@gmail.com');

1 个答案:

答案 0 :(得分:0)

Gmail会在单击下载链接时默认阻止图像下载并显示图像。所以我这样做了,图像也显示出来了。