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

前端 未结 6 617
余生分开走
余生分开走 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 09:57

    Just use "mail" for the 'protocol' array item, and that's all...

    $config = array();
            $config['useragent']    = $system_name;
            $config['mailpath']     = "/usr/bin/sendmail"; // or "/usr/sbin/sendmail"
            $config['protocol']     = "mail"; //use 'mail' instead of 'sendmail or smtp'
            $config['smtp_host']    = "your domain name";
            $config['smtp_user']    =  $from;
            $config['smtp_pass']    = "*************";
            $config['smtp_port']    =  465;
            $config['smtp_crypto']  = 'ssl';
            $config['smtp_timeout'] = "";
            $config['mailtype']     = "html";
            $config['charset']      = "utf-8";
            $config['newline']      = "\r\n";
            $config['wordwrap']     = TRUE;
            $config['validate']     = FALSE;
    

提交回复
热议问题