本文章是利用phpmailer来实现在线发送邮件功能的源码代码.
--邀请好友参加 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 = '内容'$mail->addreplyto(mailangel123@163.com, 澳优);$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();}?>
ok就完成了哦。
教程链接:
随意转载~但请保留教程地址★