issmtp(); // set mailer to use smtp$mail->host = smtp.163.com; // smtp1.example.com;smtp2.example.comspecify main and backup server$mail->smtpauth = true; // turn on smtp authentication$mail->username = mailangel123; // smtp username$mail->password = ******; // smtp password$mail->from = mailangel123@163.com;$mail->fromname = 你的好友来信;$mailbody = getcontent($type);//$array =explode('|',$rs['mail']);foreach ($array as $tmpmail) { if (@preg_match(/w+([-+.]w+)*@w+([-.]w+)*.w+([-.]w+)*/, $tmpmail) || strlen($user_mail) addreplyto(mailangel123@163.com, 44); $mail->addaddress($tmpmail, '您好!'); $mail->wordwrap = 50; $mail->charset = gb2312; //$mail->addattachment(/var/tmp/file.tar.gz); //$mail->addattachment(/tmp/image.jpg, new.jpg); $mail->ishtml(true); $mail->subject = 你的朋友邀请你一起合影!; $mail->body = $mailbody; if (!$mail->send()) { $bad++; $mail->clearaddresses(); $mail->clearattachments(); } else { $count++; } } showmsg(result:$count);}?>
下面这个文章是读取html 文档并进行html发送哦,
