<?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';