Can't send email with codeigniter

Posted June 2, 2021 189 views
$config['smtp_host'] = 'ssl://'; //change this
$config['smtp_port'] = '465';
$config['smtp_user'] = ''; //change this
$config['smtp_pass'] = '*********'; //change this
$config['mailtype'] = 'html';
$config['smtp_timeout'] = 30;     
$config['charset'] = 'utf-8';   
$config['crlf'] = "\r\n";   
$config['newline'] = "\r\n";

$message = 'Hi there';
      $email = '';
        $result = $this->email`enter code here`
        ->from("", "")
        ->reply_to("", "")
1 comment

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

Already done but nothing changed

Hi there,

What is the exact error that you get when you try to send the email?

If you have a firewall, I could suggest making sure that you have port 465 open and also test the connection to on port 465, you can do that with the telnet command:

telnet 465