0
$config = [
        'protocol'      =>  'sendmail',
        'smtp_host'     =>  'ssl://smtp.googlemail.com',
        'smtp_user'     =>  '***************',
        'smtp_pass'     =>  '********',
        'smtp_port'     =>   465,
        'smtp_timeout'  =>  '30', 
        'mailtype'      =>  'html',
        // 'ssl'            =>  [
        //                      'verify_peer'       => false,
        //                      'veriry_peer_name'  => false,
        //                      'allow_self_sign'   => true
        //                  ],// ini hanya jika jaringa tidak ssl/https, jangan dilakukan di produksi
        'starttls'      =>  true,
        'charset'       =>  'utf-8',
        'newline'       =>  "\r\n"
    ];

Hi All, I have I have tried to send mail from my local host but it return error like bellow,

Message: stream_socket_enable_crypto(): SSL/TLS already set-up for this stream

Thank you for your help,

1 Answers1

0

for sending mail from local i'm using SMTP. Please change your code with following code. It's working for me. Do not edit system file. That will create problem for you in future.

$config['protocol'] = 'smtp';
$config['smtp_host'] = 'ssl://smtp.googlemail.com';
$config['smtp_user'] = '********'; //your email id
$config['smtp_pass'] = '********'; //email id password
$config['smtp_port'] = 465; 
$config['smtp_timeout'] = 5;
$config['wordwrap'] = TRUE;
$config['wrapchars'] = 76;
$config['mailtype'] = 'html';
$config['charset'] = 'utf-8';
$config['validate'] = FALSE;
$config['priority'] = 3;
$config['crlf'] = "\r\n";
$config['newline'] = "\r\n";
$config['bcc_batch_mode'] = FALSE;
$config['bcc_batch_size'] = 200;
Jayesh
  • 161
  • 11