Home > Backend Development > PHP Tutorial > 邮件发送、失败

邮件发送、失败

WBOY
Release: 2016-06-13 13:44:45
Original
1216 people have browsed it

求助:邮件发送、、、失败

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->

require_once ('email.class.php');
//##########################################
$smtpserver = "smtp.qq.com";//SMTP服务器
$smtpserverport =25;//SMTP服务器端口
$smtpusermail = "1037572236@qq.com";//SMTP服务器的用户邮箱
$smtpemailto = "1037572236@qq.com";//发送给谁
$smtpuser = "1037572236";//SMTP服务器的用户帐号
$smtppass = $pw;//SMTP服务器的用户密码
$mailsubject = "PHP100测试邮件系统";//邮件主题
$mailbody = "<h1> 这是一个测试程序 PHP100.com </h1>";//邮件内容
$mailtype = "HTML";//邮件格式(HTML/TXT),TXT为文本邮件
##########################################
$smtp = new smtp($smtpserver,$smtpserverport,true,$smtpuser,$smtppass);//这里面的一个true是表示使用身份验证,否则不使用身份验证.
$smtp->debug = true;//是否显示发送的调试信息
$smtp->sendmail($smtpemailto, $smtpusermail, $mailsubject, $mailbody, $mailtype);

?>
Copy after login


提示错误:
Trying to smtp.qq.com:25 
220 smtp.qq.com Esmtp QQ Mail Server 
Connected to relay host smtp.qq.com 
> HELO localhost 
250 smtp.qq.com 
> AUTH LOGIN MTAzNzU3MjIzNg== 

Error: Remote host returned "" 
Error: Error occurred while sending HELO command. 
Error: Cannot send email to  
Disconnected from remote host 

MIME-Version:1.0 Content-Type:text/html To: 1037572236@qq.com From: 1037572236@qq.com Subject: PHP100测试邮件系统 Date: Thu, 15 Sep 2011 08:26:15 +0000 X-Mailer:By Redhat (PHP/5.2.5) Message-ID:

------解决方案--------------------
smtp.qq.com qq有提供SMTP,POP3?
------解决方案--------------------
是否安装了smtp service 
25端口是否开启
------解决方案--------------------
腾讯的发送邮件服务器:smtp.qq.com,使用SSL,端口号465或587
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template