以下脚本不会在电子邮件中嵌入图像。相反,它删除了 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');