Unable to send SMTP errors in codeigniter 3

advertisements

This is my code, I tried smtp_port 587,465, and 25 too. But I'm unable to send an email. And my website is not SSL so I avoid ssl://smtp.googlemail.com instead of I use smtp.googlemail.com and I also tried with ssl://smtp.googlemail.com

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('[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();
}

How can I solve this ? can you help me please I appreciate your valuable answer

Please click to show my errors

or

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:


When I got that error something with my authentication was wrong.

Make sure to disable two step verification or enable access for less secure apps.

This tutorial did the trick for me.

Hope it helps