Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method

前端 未结 6 629
余生分开走
余生分开走 2021-01-05 08:58

Iam using codeigniter

I exicuted the code on live server. got the following error using print_debugger()

Unable to send email using PHP SMTP.

6条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-05 10:01

    $mail_config['smtp_host'] = 'smtp.gmail.com';
    $mail_config['smtp_port'] = '587';
    $mail_config['smtp_user'] = 'user@example.com';
    $mail_config['_smtp_auth'] = TRUE;
    $mail_config['smtp_pass'] = 'password';
    $mail_config['smtp_crypto'] = 'tls';
    $mail_config['protocol'] = 'smtp';
    $mail_config['mailtype'] = 'html';
    $mail_config['send_multipart'] = FALSE;
    $mail_config['charset'] = 'utf-8';
    $mail_config['wordwrap'] = TRUE;
    $this->email->initialize($mail_config);
    
    $this->email->set_newline("\r\n");
    

    I just added the last line

提交回复
热议问题