首页 > 代码库 > phpmailer 发送邮件

phpmailer 发送邮件

<?php/*1,引入2,配置3,实例化*/require(‘./PHPMailer/class.phpmailer.php‘);$phpmailer = new PHPMailer();$phpmailer->IsSMTP();$phpmailer->Host = ‘smtp.163.com‘;$phpmailer->SMTPAuth =true;$phpmailer->CharSet = ‘utf8‘;$phpmailer->Username =‘15136122762‘;$phpmailer->Password =‘yjx571‘;$phpmailer->From = ‘15136122762@163.com‘;$phpmailer->FromName = ‘15136122762‘;$phpmailer->Subject =‘我来自山东‘;$phpmailer->Body= ‘俺叫武二郎‘;$phpmailer->AddAddress(‘15136122762@163.com‘,‘15136122762‘);echo $phpmailer->send()?‘ok‘:‘fail‘;

 

phpmailer 发送邮件