<?php include ('class/class.phpmailer.php'); $config = array( 'host'=>'smtp.163.com', 'port'=>'25', 'user'=>'***', 'passwd'=>'****', 'from'=>'juva_zz@163.com', 'fromname'=>'郑州', ); $subject = 'this is a test mail'; $body = '<table style="background:#dfdfdf"><tr><td>测试内容</td></tr><tr><td>这是内容</td></tr></table>'; $address='379018082@qq.com'; $username='本人'; $mail = new PHPMailer(); $mail->CharSet = 'gb2312'; $mail->IsSMTP(); $mail->Host = $config['host']; $mail->Port = $config['port']; $mail->From = $config['from']; $mail->FromName = $config['fromname']; $mail->SMTPAuth = true; $mail->Username = $config['user']; $mail->Password = $config['passwd']; $mail->Subject=$subject; $mail->AltBody="text/html"; $mail->MsgHTML($body); $mail->AddAddress($address,$username); if(!$mail->Send()) { echo "Mail Error :".$mail->ErrorInfo; }else { echo "恭喜发送成功!"; }
以上是小编为您精心准备的的内容,在的博客、问答、公众号、人物、课程等栏目也有的相关内容,欢迎继续使用右上角搜索按钮进行搜索邮件
, 实例
phpmailer
phpmailer发送邮件、phpmailer 发送邮件慢、php发送邮件实例、phpmailer实例、phpmailer 群发邮件,以便于您获取更多的相关知识。
时间: 2024-10-01 15:29:34