Email cakephp 2.7电子邮件发送问题。不允许SMTP身份验证方法,请检查SMTP服务器是否需要TLS
我想使用iPage smtp发送电子邮件,因为它正在发送电子邮件 但是当我尝试使用mail.mydomain.com发送它时,会显示以下错误Email cakephp 2.7电子邮件发送问题。不允许SMTP身份验证方法,请检查SMTP服务器是否需要TLS,email,tls1.2,cakephp-2.3,Email,Tls1.2,Cakephp 2.3,我想使用iPage smtp发送电子邮件,因为它正在发送电子邮件 但是当我尝试使用mail.mydomain.com发送它时,会显示以下错误 SMTP authentication method not allowed, check if SMTP server requires TLS. 我还使用了trues tls=true/false,其中'tls'=>true给出了这个错误 SMTP server did not accept the connection or trying to c
SMTP authentication method not allowed, check if SMTP server requires TLS.
我还使用了trues tls=true/false,其中'tls'=>true
给出了这个错误
SMTP server did not accept the connection or trying to connect to non TLS SMTP server using TLS.
我尝试了很多方法,但都没有成功,我如何在CakePHP2.7中追踪这个问题
tmp/error.log上记录的错误为
2018-08-05 15:02:05 Error: [SocketException] SMTP authentication method not allowed, check if SMTP server requires TLS.
Request URL: /survey/clearance_forms/check
Stack Trace:
#0 C:\wamp64\www\survey\lib\Cake\Network\Email\SmtpTransport.php(87): SmtpTransport->_auth()
#1 C:\wamp64\www\survey\lib\Cake\Network\Email\CakeEmail.php(1173): SmtpTransport->send(Object(CakeEmail))
#2 C:\wamp64\www\survey\app\Controller\Component\SendComponent.php(60): CakeEmail->send('<html><body sty...')
#3 C:\wamp64\www\survey\app\Controller\ClearanceFormsController.php(424): SendComponent->email(Array)
#4 C:\wamp64\www\survey\app\Controller\ClearanceFormsController.php(406): ClearanceFormsController->studentEmail('admin@mydomain.com', 'testing')
#5 [internal function]: ClearanceFormsController->check()
#6 C:\wamp64\www\survey\lib\Cake\Controller\Controller.php(491): ReflectionMethod->invokeArgs(Object(ClearanceFormsController), Array)
#7 C:\wamp64\www\survey\lib\Cake\Routing\Dispatcher.php(193): Controller->invokeAction(Object(CakeRequest))
#8 C:\wamp64\www\survey\lib\Cake\Routing\Dispatcher.php(167): Dispatcher->_invoke(Object(ClearanceFormsController), Object(CakeRequest))
#9 C:\wamp64\www\survey\app\webroot\index.php(111): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))
#10 {main}
我希望这将为您工作,让我们知道结果
class EmailConfig {
public $smtp = array(
'transport' => 'Smtp',
'from' => array('admin@mydomain.com' => 'admin'),
'host' => 'mail.mydomain.com',
'port' => 25,
'timeout' => 30,
'username' => 'admin@mydomain.com',
'password' => '********',
'client' => null,
'log' => false,
/*********************** changes starts here ************/
'SMTPSecure' => 'starttls',
'tls' => true,
'context'=>array('ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)),
/*********************** changes ends here ************/
'charset' => 'utf-8',
'headerCharset' => 'utf-8',
);
}
请发布更新请显示您用于发送电子邮件的代码,包括任何相关配置详细信息(当然,用户名和密码已混淆)。
class EmailConfig {
public $smtp = array(
'transport' => 'Smtp',
'from' => array('admin@mydomain.com' => 'admin'),
'host' => 'mail.mydomain.com',
'port' => 25,
'timeout' => 30,
'username' => 'admin@mydomain.com',
'password' => '********',
'client' => null,
'log' => false,
/*********************** changes starts here ************/
'SMTPSecure' => 'starttls',
'tls' => true,
'context'=>array('ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)),
/*********************** changes ends here ************/
'charset' => 'utf-8',
'headerCharset' => 'utf-8',
);
}