php发送邮件方法二2.(SMTP传输SMTP类调用发送)_PHP教程

WBOY
Libérer: 2016-07-13 17:52:02
original
838 Les gens l'ont consulté

[html]
require_once("email2.php");//此为php发送邮件方法二2.(SMTP传输SMTP类) 
/** 
*服务器信息 
*/ 
$MailServer = 'smtp.163.com';      //SMTP 服务器 
$MailPort   = '25';                  //SMTP服务器端口号 默认25 
$MailId     = 'anheng123@163.com';  //服务器邮箱帐号 
$MailPw     = 'xxxxxxxxxxx';                 //服务器邮箱密码 
 
/** 
*客户端信息 
*/ 
$Title      = '系统开发人员报告错误信息';        //邮件标题 
 
$bt="sadfsadf"; 
$_POST['url']="afasdfasfasfsaf"; 
$_POST['lianxi']="12312412"; 
$_POST['xiangxi']="说的话头isa而感觉撒改的"; 
$td=$subject.'
'.'标题:'.$bt.'
'.'url:'.$_POST['url'].'
'.'联系电话:'.$_POST['lianxi'].'
'.'详细内容:'.$_POST['xiangxi']; 
 
 
 
$Content    = $td;        //邮件内容 
$email      = www.2cto.com目标 接收者邮箱 
 
 
$smtp = new smtp($MailServer,$MailPort,true,$MailId,$MailPw); 
$smtp->debug = false; 
if($smtp->sendmail($email,$MailId, $Title, $Content, "HTML")){ 
     echo '邮件发送成功';            //返回结果 
} else { 
     echo '邮件发送失败';            //$succeed = 0; 

?> 
作者:Vericlongmore

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/478150.htmlTechArticle[html] ?php require_once(email2.php);//此为php发送邮件方法二2.(SMTP传输SMTP类) /** *服务器信息 */ $MailServer = smtp.163.com; //SMTP 服务器 $MailPort = 25; //SMT...
source:php.cn
Déclaration de ce site Web
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn
Tutoriels populaires
Plus>
Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!