2016-07-13 2 views
2

Это мой код, я пробовал smtp_port 587 465 и 25 тоже. Но я не могу отправить электронное письмо. И мой сайт не SSL, поэтому я избежать SSL: //smtp.googlemail.com вместо я использую smtp.googlemail.com, и я также попытался с SSL: //smtp.googlemail.comНе удалось отправить электронную почту Ошибки SMPT в codigniter 3

public function email() 
{ 
    $config = Array(
     'protocol' => 'smtp', 
     'smtp_host' => 'smtp.googlemail.com', 
     'smtp_port' => 465, 
     'smtp_user' => '******', 
     'smtp_pass' => '******', 
     'mailtype' => 'html', 
     'charset' => 'iso-8859-1' 
    ); 
    $this->load->library('email', $config); 
    $this->email->set_newline("\r\n"); 

    $this->email->from('[email protected]', 'Vizag updates'); 
    $this->email->to('s[email protected]'); 
    $this->email->subject('Activation link...! Vizag updates'); 
    $msg = "your activation link <a href='base_url'>click here</a>"; 
    $this->email->message($msg); 
    $this->email->send(); 
    echo $this->email->print_debugger();  
} 

Как я могу это решить? Вы можете мне помочь, пожалуйста, я ценю ваш ценный ответ

Please click to show my errors

или

A PHP Error was encountered 

Severity: Notice 

Message: fwrite(): send of 6 bytes failed with errno=32 Broken pipe 

Filename: libraries/Email.php 

Line Number: 2172 

Backtrace: 

A PHP Error was encountered 

Severity: Notice 

Message: fwrite(): send of 6 bytes failed with errno=32 Broken pipe 

Filename: libraries/Email.php 

Line Number: 2172 

Backtrace: 

A PHP Error was encountered 

Severity: Notice 

Message: fwrite(): send of 6 bytes failed with errno=32 Broken pipe 

Filename: libraries/Email.php 

Line Number: 2172 

Backtrace: 

A PHP Error was encountered 

Severity: Notice 

Message: fwrite(): send of 6 bytes failed with errno=32 Broken pipe 

Filename: libraries/Email.php 

Line Number: 2172 

Backtrace: 

A PHP Error was encountered 

Severity: Notice 

Message: fwrite(): send of 6 bytes failed with errno=32 Broken pipe 

Filename: libraries/Email.php 

Line Number: 2172 

Backtrace: 

A PHP Error was encountered 

Severity: Notice 

Message: fwrite(): send of 6 bytes failed with errno=32 Broken pipe 

Filename: libraries/Email.php 

Line Number: 2172 

Backtrace: 

A PHP Error was encountered 

Severity: Notice 

Message: fwrite(): send of 6 bytes failed with errno=32 Broken pipe 

Filename: libraries/Email.php 

Line Number: 2172 

Backtrace: 

A PHP Error was encountered 

Severity: Notice 

Message: fwrite(): send of 6 bytes failed with errno=32 Broken pipe 

Filename: libraries/Email.php 

Line Number: 2172 

Backtrace: 

A PHP Error was encountered 

Severity: Notice 

Message: fwrite(): send of 6 bytes failed with errno=32 Broken pipe 

Filename: libraries/Email.php 

Line Number: 2172 

Backtrace: 

A PHP Error was encountered 

Severity: Notice 

Message: fwrite(): send of 6 bytes failed with errno=32 Broken pipe 

Filename: libraries/Email.php 

Line Number: 2172 

Backtrace: 

A PHP Error was encountered 

Severity: Notice 

Message: fwrite(): send of 6 bytes failed with errno=32 Broken pipe 

Filename: libraries/Email.php 

Line Number: 2172 

Backtrace: 

A PHP Error was encountered 

Severity: Notice 

Message: fwrite(): send of 6 bytes failed with errno=32 Broken pipe 

Filename: libraries/Email.php 

Line Number: 2172 

Backtrace: 

A PHP Error was encountered 

Severity: Notice 

Message: fwrite(): send of 6 bytes failed with errno=32 Broken pipe 

Filename: libraries/Email.php 

Line Number: 2172 

Backtrace: 

A PHP Error was encountered 

Severity: Notice 

Message: fwrite(): send of 6 bytes failed with errno=32 Broken pipe 

Filename: libraries/Email.php 

Line Number: 2172 

Backtrace: 

A PHP Error was encountered 

Severity: Notice 

Message: fwrite(): send of 6 bytes failed with errno=32 Broken pipe 

Filename: libraries/Email.php 

Line Number: 2172 

Backtrace: 

A PHP Error was encountered 

Severity: Notice 

Message: fwrite(): send of 6 bytes failed with errno=32 Broken pipe 

Filename: libraries/Email.php 

Line Number: 2172 

Backtrace: 

A PHP Error was encountered 

Severity: Notice 

Message: fwrite(): send of 6 bytes failed with errno=32 Broken pipe 

Filename: libraries/Email.php 

Line Number: 2172 

Backtrace: 

A PHP Error was encountered 

Severity: Notice 

Message: fwrite(): send of 6 bytes failed with errno=32 Broken pipe 

Filename: libraries/Email.php 

Line Number: 2172 

Backtrace: 

A PHP Error was encountered 

Severity: Notice 

Message: fwrite(): send of 6 bytes failed with errno=32 Broken pipe 

Filename: libraries/Email.php 

Line Number: 2172 

Backtrace: 

A PHP Error was encountered 

Severity: Notice 

Message: fwrite(): send of 6 bytes failed with errno=32 Broken pipe 

Filename: libraries/Email.php 

Line Number: 2172 

Backtrace: 

A PHP Error was encountered 

Severity: Notice 

Message: fwrite(): send of 6 bytes failed with errno=32 Broken pipe 

Filename: libraries/Email.php 

Line Number: 2172 

Backtrace: 

A PHP Error was encountered 

Severity: Notice 

Message: fwrite(): send of 6 bytes failed with errno=32 Broken pipe 

Filename: libraries/Email.php 

Line Number: 2172 

Backtrace: 

A PHP Error was encountered 

Severity: Notice 

Message: fwrite(): send of 6 bytes failed with errno=32 Broken pipe 

Filename: libraries/Email.php 

Line Number: 2172 

Backtrace: 

A PHP Error was encountered 

Severity: Notice 

Message: fwrite(): send of 6 bytes failed with errno=32 Broken pipe 

Filename: libraries/Email.php 

Line Number: 2172 

Backtrace: 
+0

Вашим образ очень мал, не может читать ошибки. – user4419336

+0

Теперь вы можете видеть или использовать увеличение в моем изображении – Siddhu

ответ

2

Когда я получил что-то ошибка с моей аутентификации было неправильно.

Обязательно отключите двухэтапную аутентификацию или разрешите доступ для менее безопасных приложений.

This tutorial сделал трюк для меня.

Надеется, что это помогает

+0

Я уже пробовал этот @jonas ... но все же я столкнулся с ошибками – Siddhu

+0

@ Сиддху вы пытались установить 'smtp_crypto' => 'ssl'? – TrueStory

+0

Да, я попробовал @jonas. после этого я получаю это предупреждение. Серьезность: предупреждение Сообщение: fsockopen(): не удалось подключиться к ssl: //smtp.gmail.com: 465 (Connection failed) Имя файла: libraries/Email.php – Siddhu

0

наконец, я решил

нам необходимы предоставить разрешения на доступ к Google https://support.google.com/accounts/answer/6010255?hl=en

public function send() 
{ 
    $config = Array(
     'protocol' => 'smtp', 
     'smtp_host' => 'ssl://smtp.googlemail.com', 
     'smtp_port' => 465, 
     'smtp_user' => '****@gmail.com', 
     'smtp_pass' => '***', 
     'mailtype' => 'html', 
     'charset' => 'iso-8859-1' 
    ); 
    $this->load->library('email', $config); 
    $this->email->set_newline("\r\n"); 
    $this->email->from('[email protected]', 'admin'); 
    $this->email->to('[email protected], [email protected]'); 
    $this->email->subject('Registration Verification:'); 
    $message = "Thanks for signing up! Your account has been created...!"; 
    $this->email->message($message); 
    if (! $this->email->send()) { 
     show_error($this->email->print_debugger()); 
    } 

} 
Смежные вопросы