2014-10-04 115 views
3

无法验证密码。错误:534-5.7.14请通过您的网络浏览器登录,然后重试。 534-5.7.14了解更多534 5.7.14 https://support.google.com/mail/bin/answer.py?answer=78754 wv1sm5867206pab.37 - gsmtp使用codeigniter验证密码失败

function index() { 

    $config = Array(
     'protocol' => 'smtp', 
     'smtp_host' => 'ssl://smtp.googlemail.com', 
     'smtp_port' => 465, 
     'smtp_user' => '[email protected]', 
     'smtp_pass' => '92135108845129', 
     'mailtype' => 'html', 
     'charset' => 'iso-8859-1', 
     'wordwrap' => TRUE 

    ); 

    $this->load->library('email', $config); 
    $this->email->set_newline("\r\n"); 
    $this->email->from('[email protected]', 'Gaurav kwatra'); 
    $this->email->to('[email protected]'); 
    $this->email->subject('This is an email test'); 
    $this->email->message('Emial Testing'); 

     //$this->email->initialize($config); 

    if($this->email->send()) 
    { 
     echo 'Your email sent...!!!! '; 
    } 
    else 
    { 
     show_error($this->email->print_debugger()); 
    } 
} 
//end of code 

我用上面的代码从笨发送邮件....我有一个错误...验证失败。密码正确。

+0

这可能有所帮助:http://stackoverflow.com/a/20645752/1001641 – 2014-10-04 14:11:24

回答

6

你需要去你的账户设置https://www.google.com/settings/security,你需要启用Access for less secure apps这有助于使用谷歌smtp的客户端。

请看看here

+0

在某些情况下,即使启用安全性较低的应用程序,此错误仍会继续显示。 – William 2015-09-10 19:40:43

+1

请注意,您必须等待一小会儿在启用安全性较低的应用程 – bokan 2016-03-17 17:57:57

+0

下面是提到的设置页面的新的直接链接:https://www.google.com/settings/security/lesssecureapps – 2016-09-21 19:05:51

0

如果仍然甚至不启用安全性较低的应用程序后,工作 - 您应该在谷歌帐户中登录到您的安全区域,查看设备是否已被封锁。 Google屏蔽了我的服务器,然后我去了https://accounts.google.com/b/0/displayunlockcaptcha,它现在允许我发送。与用户名或密码无关,但Google阻止设备访问。

0

其中一个原因可能是cpanel设置。请尝试:

  1. 登录的cPanel
  2. 调整设置>所有>
  3. “限制传出SMTP根,进出口,以及邮差(FKA SMTP调整)

选择 “关闭”