使用 PHPMAILER 发送邮件实例
2012-11-05 15:40
776 查看
<?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='******@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发送邮件实例
- 使用 PHPMAILER 发送邮件实例应用
- 使用 PHPMAILER 发送邮件实例应用
- phpmailer使用qq邮箱、163邮箱成功发送邮件实例代码
- php使用phpmailer发送邮件实例解析
- 二种python发送邮件实例讲解(python发邮件附件可以使用email模块实现)
- ThinkPHP 中使用 PHPMailer 发送邮件
- 使用phpmailer发送邮件,且需要激活完整代码
- PHP使用PHPMailer发送邮件
- PHP 实现 注册等的邮箱验证 (二)—— 使用 PHPMailer 发送邮件
- 使用Apache email组件发送邮件实例
- ThinkPHP3.12使用PHPMailer发送邮件
- ThinkPHP_phpmailer使用外部认证SMTP发送邮件
- CI框架使用PHPmailer发送邮件找回密码
- Wordpress无法发送邮件,基于插件“Contact Form 7”,修改class-phpmailer.php使用SMTP解决。
- Linux 下使用命令行发送邮件最简实例
- 使用PHPMailer发送邮件
- 在Thinkphp3.2 中使用PHPMailer 发送邮件
- php使用phpmailer发邮件,在window可以使用,linux无法发送邮件,出现could not connect to smtp host错误