Home > php教程 > php手册 > PHP邮件发送(已测试成功)

PHP邮件发送(已测试成功)

WBOY
Release: 2016-06-21 08:46:35
Original
797 people have browsed it

/** 用PHPMailer类来发信   步骤: 0: 引入 1: 实例化 2: 配置属性 3: 调用发送   **/   require('./PHPMailer/class.phpmailer.php');   $phpmailer = new PHPMailer();     /* 设置phpmailer发信用的方式 可用用win下mail()函数来发 可以用linux下sendmail,qmail组件来发 可以利用smtp协议登陆到某个账户上,来发 */   $phpmailer->IsSMTP();  // 用smtp协议来发   $phpmailer->Host = 'smtp.163.com'; $phpmailer->SMTPAuth = true; $phpmailer->Username = '';  //发送邮箱的账号(用163邮箱发信的账号) $phpmailer->Password = '';  //发送邮箱的密码   // 可以发信了 $phpmailer->CharSet='utf-8'; $phpmailer->From = 'never_kill@163.com'; $phpmailer->FromName = 'neverkill'; $phpmailer->Subject = 'Superstart Aseoe'; $phpmailer->Body = '爱思资源网(http://www.aseoe.com/)- 专注前端开发与PHP编程设计.';   //设置收信人 $phpmailer->AddAddress('never_kill@163.com','neverkill'); // 添加一个抄送 $phpmailer->AddCC('597417106@qq.com','Aseoe');   // 发信   echo $phpmailer->send()?'ok':'fail';

PHP邮件发送实例下载

PHP查看邮件是否已被阅读



Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template