http://expert.csdn.net/Expert/topic/1125/1125292.xml?temp=.4890863
解决方案 »
- PHP odbc access select 正常,UPDATE 提示参数不足期待是1
- 求帮助
- php中select的option自动改变的问题
- 如何把PHP数组转化成javascript 数组
- 一个简单的js 救助 急急急!!
- 有Asp,C++基础,想尽快上手PHP,求学习资料和文档
- 我用session_set_save_handler()把session存到数据库中了,可是一设置过期时间为1个小时,可是我关闭浏览器,再打开该页面,却还要登陆
- 求教高人:在Win2k+IIS5.0下,如何设置php4.2.3?
- 向专家求解几个问题,关于php4.1.2
- 用什么方法能知道论坛COOKIE记录了我什么信息?
- 请问如何把长的文章分页??
- MySQL语句用ORDER BY排序后怎样提取第N到N+10条记录?
要的话给我发信...
[email protected]
先谢了
http://www.hooday.com/?n=Classes&t=12
[mail function]
; For Win32 only.
SMTP = bestdns.net; For Win32 only.
sendmail_from = [email protected]; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =如果你这个好用.或你能找到一个好使的服务加上去那么mail就会好使的.你试试吧.有好的服务器告诉我呀.呵呵.
$CC = "yourname@yourhost";//Form
$MP = "/usr/sbin/sendmail -t";$filename = "./content.html";//信件要包含的html内容
$fd = fopen( $filename, "r" );
$contents = fread($fd, filesize($filename));
fclose( $fd ); $mail_array = file("./mail.txt");//收信人地址(每个E-mail地址占一行)
reset($mail_array)
foreach($mail_array as $key => $val){
$TO = $val;
$fd = popen($MP,"w");
fputs($fd, "To: $TO\n");
fputs($fd, "Cc: $CC\n");
fputs($fd, "From: your_name <your_login@your_domain_name>\n");
fputs($fd, "Subject: á?×óD?D?ê1 \n");
fputs($fd, "X-Mailer: PHP\n");
fputs($fd, "Content-Type: text/html; charset=us-ascii\n");
fputs($fd, "Content-Transfer-Encoding: 7bit\n");
fputs($fd, $contents);
// fputs($fd, "</body>\n");
pclose($fd);
exit;
echo "<li>".$val."发送成功";
}
?>从一个老外那里改的mail发送代码,就是发html内容用的。
能给多个地址发信但平台只能在*nix上,而且没有用到mail函数
但道理一样,应该对你有用的。呵呵。
$to="[email protected]";//a mail address
$subject="test mail";
$body="<table width='100%' border='1' cellspacing='0' cellpadding='0'>
<tr>
<td>11</td>
<td>12</td>
</tr>
<tr>
<td>21</td>
<td>22</td>
</tr>
</table>";
echo $subject;
echo $from;
$send=mail($to,$subject,stripslashes($body),"From: ".$from."\r\nContent-Type: text/html;charset=\"gb2312\"");
if($send)
echo "send";
else
echo "not send";
?>