诚恳请求PHP 发多媒体邮件 就是能把HTML格式的邮件发出去 100小谢各位 http://pear.php.net/package/Mail_Mimehttp://pear.php.net/package/Net_SMTP 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这个有点复杂,你首先要先学会发送有附件的邮件的方法。学习之后就很容易了,html带图片和声音的代码:仅供参考<?$gahob[mailto] = "\"IT_Info\" <[email protected]>";$gahob[mailfrom] = "\"IT_James\" <[email protected]>";$gahob[subject] = "Test_SendMail";$NextPart_1 = "----=_NextPart_".md5(uniqid(rand())); $NextPart_2 = "----=_NextPart_".md5(uniqid(rand())); $mailfile = "001.gif";$fp = fopen($mailfile, "r"); $read = fread($fp, filesize($mailfile)); $read = base64_encode($read); $read = chunk_split($read);$gahob[message] = "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\"><title>Midland</title></head><body><img src=\"cid:$NextPart_1\"></html>"; $gahob[headers] = "From: $gahob[mailfrom]MIME-Version: 1.0Content-Type: multipart/related; type=\"multipart/alternative\"; boundary=\"$NextPart_1\""; $gahob[message2] = "--$NextPart_1Content-Type: multipart/alternative; boundary=\"$NextPart_2\"--$NextPart_2Content-Type: text/plain; charset=\"gb2312\"Content-Transfer-Encoding: base64--$NextPart_2Content-Type: text/html; charset=\"gb2312\"Content-Transfer-Encoding: 8bit$gahob[message]--$NextPart_2----$NextPart_1Content-Type: image/gif; name=\"$filename\"Content-Transfer-Encoding: base64Content-ID: <$NextPart_1>$read--$NextPart_1--"; if(mail($gahob[mailto], $gahob[subject], $gahob[message2], $gahob[headers]))echo "OKOK";?> 欢迎加入PHP WAP QQ群8352641 大家一起交流,一起进步.共同发展 用php将excel文件导入数据库文件过大应该怎么修改 PHP数字金额转大小格式,求解? 新手讨教学习PHP的方法 js提交表单取不到数据 有劳高手指点 system()执行中的问题 如何把这段php代码改成asp的 当session失效时,可以调用事件吗?怎么实现? 急~~ 再问,各位老大救命呀!:-( PHP如何和SQL server连接? 一个时间的问题 真怪哦.PHP连接数据库
html带图片和声音的代码:仅供参考
<?
$gahob[mailto] = "\"IT_Info\" <[email protected]>";
$gahob[mailfrom] = "\"IT_James\" <[email protected]>";
$gahob[subject] = "Test_SendMail";
$NextPart_1 = "----=_NextPart_".md5(uniqid(rand()));
$NextPart_2 = "----=_NextPart_".md5(uniqid(rand()));
$mailfile = "001.gif";
$fp = fopen($mailfile, "r");
$read = fread($fp, filesize($mailfile));
$read = base64_encode($read);
$read = chunk_split($read);$gahob[message] = "<html>
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">
<title>Midland</title>
</head><body>
<img src=\"cid:$NextPart_1\">
</html>";
$gahob[headers] = "From: $gahob[mailfrom]
MIME-Version: 1.0
Content-Type: multipart/related;
type=\"multipart/alternative\";
boundary=\"$NextPart_1\""; $gahob[message2] = "--$NextPart_1
Content-Type: multipart/alternative;
boundary=\"$NextPart_2\"
--$NextPart_2
Content-Type: text/plain;
charset=\"gb2312\"
Content-Transfer-Encoding: base64
--$NextPart_2
Content-Type: text/html;
charset=\"gb2312\"
Content-Transfer-Encoding: 8bit$gahob[message]--$NextPart_2----$NextPart_1
Content-Type: image/gif;
name=\"$filename\"
Content-Transfer-Encoding: base64
Content-ID: <$NextPart_1>$read--$NextPart_1--"; if(mail($gahob[mailto], $gahob[subject], $gahob[message2], $gahob[headers]))
echo "OKOK";
?>