SMTPDebug = 0; //使用SMPT验证 $mail->SMTPAuth = true; //SMTP验证的用户名称 $mail->Username = ""; //SMTP验证的秘密 $mail->Password = ""; //设置编码格式 $mail->CharSet = &"/> SMTPDebug = 0; //使用SMPT验证 $mail->SMTPAuth = true; //SMTP验证的用户名称 $mail->Username = ""; //SMTP验证的秘密 $mail->Password = ""; //设置编码格式 $mail->CharSet = &">
Heim > Backend-Entwicklung > PHP-Tutorial > php发送邮件问题(smtp的问题)

php发送邮件问题(smtp的问题)

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Freigeben: 2016-06-02 11:33:29
Original
984 Leute haben es durchsucht

php

require_once('./class.phpmailer.php');
$mail= new PHPMailer();
$body= "发送邮件成功";
//采用SMTP发送邮件
$mail->IsSMTP();
//邮件服务器
$mail->Host = "smtp.163.com";
$mail->SMTPDebug = 0;
//使用SMPT验证
$mail->SMTPAuth = true;
//SMTP验证的用户名称
$mail->Username = "";
//SMTP验证的秘密
$mail->Password = "";
//设置编码格式
$mail->CharSet = "utf-8";
//设置主题
$mail->Subject = "测试";

//设置发送者
$mail->SetFrom('****@163.com', 'test');

//接受者邮件名称
$mail->AddAddress("***@163.com", "test");//发送邮件
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}
?>
这个代码的问题在哪 ????

Verwandte Etiketten:
php
Quelle:php.cn
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Aktuelle Ausgaben
PHP-Datenerfassung?
Aus 1970-01-01 08:00:00
0
0
0
PHP-Erweiterung intl
Aus 1970-01-01 08:00:00
0
0
0
Wie man PHP gut lernt
Aus 1970-01-01 08:00:00
0
0
0
Mehrere PHP-Versionen
Aus 1970-01-01 08:00:00
0
0
0
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage