CodeIgniter:来自PHPMailer代码的SSL / TLS SMTP验证电子邮件 [英] CodeIgniter: SSL/TLS SMTP Auth Email from PHPMailer Code

查看:787
本文介绍了CodeIgniter:来自PHPMailer代码的SSL / TLS SMTP验证电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用CodeIgniter电子邮件类写一个安全的SMTP电子邮件; SSL或TLS(首选)。在过去,我已经成功地使用了安全认证和TLS的PHPMailer。我相信这是一个安全的连接。 TLS显示在电子邮件标题中。



CodeIngiters的电子邮件类是否支持使用TLS进行安全SMTP验证?



请注意,这不是一个Gmail问题。我试图用MS Exchange Server使用它。我已经正确地确认了下面的PHPMailer代码。

  include_once('includes / class.phpmailer.php'); 
$ mail = new PHPMailer(true);
$ mail-> IsSMTP();
$ mail-> Host ='www.domain.com';

$ mail-> SMTPAuth = true;
$ mail-> SMTPSecure =tls;
$ mail-> Port ='25';
$ mail-> Timeout ='60';

$ mail->用户名='user@domain.com';
$ mail-> Password ='password';

$ mail-> From ='alerts@domain.com';
$ mail-> FromName ='Alerts';

$ mail-> Subject ='测试电子邮件文件'。
$ mail-> IsHTML(true);
$ mail-> MsgHTML('这只是一个测试');

//到
$ mail-> AddAddress('alerts@domain.com','研究');
$ result = $ mail-> Send();

使用CodeIgniter我已经扩展了电子邮件类(MY_Email.php)。这个课程有点大。但是,这是我不断得到的错误。



设置:

  array(7){
[smtp_host] => string(26)tls://www.domain.com
[smtp_port] => string(2)25
[smtp_user] => string(17)alerts@domain.com
[smtp_pass] => string(9)password
[smtp_to_email] => string(26)user@domain.com
[smtp_from_email] => string(26)user@domain.com
[smtp_from_name] =>字符串(24)从应用程序测试
}

错误消息:


fsockopen():SSL操作失败与代码1. OpenSSL错误消息:错误:1408F10B:SSL例程:func(143):reason(267) / p>

任何想法267是什么原因?

解决方案>

在CI论坛上找到解决方案。



Exchange电子邮件类别补丁
http://codeigniter.com/forums/viewthread/158882/



它正在启动TLS SMTP服务器已连接。



为我工作。杰夫


I'm trying to use the CodeIgniter Email Class to write a secure SMTP email; either SSL or TLS (preferred). In the past, I've successfully used PHPMailer with Secure Auth and TLS. I believe it was a secure connection. TLS shows up in the email header.

Does CodeIngiters' Email Class support secure SMTP authentication with TLS?

Note, this is not a Gmail question. I'm trying to use it with an MS Exchange Server. I've confirmed the PHPMailer code below functions correctly.

include_once('includes/class.phpmailer.php');
$mail = new PHPMailer(true);
$mail->IsSMTP();
$mail->Host = 'www.domain.com';

$mail->SMTPAuth = true;
$mail->SMTPSecure = "tls";
$mail->Port     = '25';
$mail->Timeout  = '60';

$mail->Username = 'user@domain.com';
$mail->Password = 'password';

$mail->From     = 'alerts@domain.com';
$mail->FromName = 'Alerts';

$mail->Subject  = 'Test from test email file.';
$mail->IsHTML(true);
$mail->MsgHTML('This is just a test.');

// To
$mail->AddAddress('alerts@domain.com', 'Research');
$result = $mail->Send();

With CodeIgniter I've already extended the Email Class (MY_Email.php). The class is a bit big to post here. But, here's the error I keep getting.

Settings:

array(7) { 
["smtp_host"]=> string(26) "tls://www.domain.com" 
["smtp_port"]=> string(2) "25" 
["smtp_user"]=> string(17) "alerts@domain.com" 
["smtp_pass"]=> string(9) "password" 
["smtp_to_email"]=> string(26) "user@domain.com" 
["smtp_from_email"]=> string(26) "user@domain.com" 
["smtp_from_name"]=> string(24) "Test from Application" 
}

Error Message:

fsockopen(): SSL operation failed with code 1. OpenSSL Error messages: error:1408F10B:SSL routines:func(143):reason(267)

Any idea what reason 267 is?

解决方案

Found a solution on the CI forums.

Exchange Email Class Patch http://codeigniter.com/forums/viewthread/158882/

It is initiating TLS after SMTP server has been connected.

Worked for me. Jeff

这篇关于CodeIgniter:来自PHPMailer代码的SSL / TLS SMTP验证电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆