您的位置:首页 > 运维架构 > Linux

细说Linux 系统优化

2015-06-24 08:44 489 查看
<?php
include ('class.phpmailer.php');

$config = array(
'host'=>'smtp.163.com',
'port'=>'25',
'user'=>'haocaiges@163.com',
'passwd'=>'******',
'from'=>'haocaiges@163.com',
'fromname'=>'广东',

);
$subject = 'this is a test mail';
$body = '<table style="background:#dfdfdf"><tr><td>测试内容</td></tr><tr><td>这是内容</td></tr></table>';
$address='1207204940@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 "恭喜发送成功!";
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: