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

 

posted @ 2014-11-20 14:10  王孙将归  阅读(142)  评论(0编辑  收藏  举报