Error while sending an email with CodeIgniter

前端 未结 7 1600
灰色年华
灰色年华 2020-12-06 18:25

While sending an email, I\'m receiving a bunch of such errors:

A PHP Error was encountered

Severity: Notice

Message: fwrite(): send of 12 bytes failed with         


        
7条回答
  •  爱一瞬间的悲伤
    2020-12-06 19:08

    I too was in the same situation. Was getting:

    Message: fwrite(): SSL: Broken pipe

    Filename: libraries/Email.php

    Line Number: 2250&

    the change that really made a difference was the 'smtp_crypto' config option set to 'ssl'

    $config['protocol'] = 'smtp';
    $config['smtp_host'] = 'ssl://example.com';
    $config['smtp_crypto'] = 'ssl';
    $config['smtp_port'] = '465';
    $config['smtp_user'] = 'user@example.com';
    $config['smtp_pass'] = 'password';
    $config['mailtype'] = 'html';
    $config['charset'] = 'iso-8859-1';
    $config['wordwrap'] = 'TRUE';
    

    I found this solution at https://www.codeigniter.com/user_guide/libraries/email.html by searching for SSL option.

提交回复
热议问题