用php发送电子邮件时出现SMTP server response: 553 authentication is required错误 htmlMimeMail5 你这个类没有用username,password登陆,要是自己连接服务器发信的话,不应该调用mail函数的。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这个错误是说你的SMTP不是匿名的,需要用户验证 这个htmlMimeMail5类的发送底层应该还是调用mail函数的。我上面的代码只是把自己真实的用户名和密码隐藏了,在我的程序里用的是真实的用户名和密码啊。setSMTPParams('smtp.163.com',25,'mail.smtp.auth',true,'username','password');当中的参数描述如下:第一个是smtpHost,第二个是port,第三个是HELO command,第四个是验证,的五个是用户名,第六个是密码。 这个表示需要验证至于具体情况 估计是你代码调用的问题那个类没有用过 你可以用PEAR 的smtp参考下面的代码,我发送成功的,如果你的不行就是有可能 服务器的问题 require_once "Mail.php"; class Mail{ static $mail_config=array( "host"=>"mail.xxx.com", "port"=>25, "auth"=>true, "username"=>"[email protected]", "password"=>"xxx", "from"=>"[email protected]", ); private $sender; /** * an sender's result */ private $result; function __construct(){ $this->sender=Mail::factory("smtp", self::$mail_config ); } function process($to,$subject,$body,$user,$pass){ $header=array( "Subject"=>$subject, "From"=>self::$mail_config["from"], ); $this->result=@$this->sender->send($to,$header,$body); return $this->result; } } 如何实现全站访问任何页面都是index.php一个文件的呢? jquery a标签 传值 float转换为整形的怪异问题 类成员修饰符的疑问 SqlServer 数据导入Mysql数据中,汉字为什么丢失 include的怪问题,请各位高手帮忙!谢谢!!!!非常奇怪的问题!!! 我怎么知道鼠标是点的那一个超级链接? 编辑php有什么工具 我想去做php,但是又不太敢 有没有大佬告知一下这是什么问题 怎么解决 关于PHP+AJAX查询提示“正在查找...”的问题 表格提交的数据如何能简单替换某些字符?
setSMTPParams('smtp.163.com',25,'mail.smtp.auth',true,'username','password');当中的参数描述如下:第一个是smtpHost,第二个是port,第三个是HELO command,第四个是验证,的五个是用户名,第六个是密码。
参考下面的代码,我发送成功的,如果你的不行就是有可能 服务器的问题 require_once "Mail.php";
class Mail{
static $mail_config=array(
"host"=>"mail.xxx.com",
"port"=>25,
"auth"=>true,
"username"=>"[email protected]",
"password"=>"xxx",
"from"=>"[email protected]",
);
private $sender;
/**
* an sender's result
*/
private $result;
function __construct(){
$this->sender=Mail::factory("smtp",
self::$mail_config
);
}
function process($to,$subject,$body,$user,$pass){
$header=array(
"Subject"=>$subject,
"From"=>self::$mail_config["from"],
);
$this->result=@$this->sender->send($to,$header,$body);
return $this->result;
}
}