Question

Can't send email with codeigniter

$config['smtp_host'] = 'ssl://smtp.yandex.com.tr'; //change this
$config['smtp_port'] = '465';
$config['smtp_user'] = 'no_reply@example.com'; //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 = 'noname@gmail.com';
      $this->load->library("email");
        $result = $this->email`enter code here`
        ->from("no_reply@example.com", "Example.com")
        ->reply_to("no_reply@example.com", "Example.com")
        ->to($email)
        ->subject("Notification")
        ->message($message)
        ->send();
Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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 smtp.yandex.com.tr on port 465, you can do that with the telnet command:

telnet smtp.yandex.com.tr 465

Regards, Bobby

Already done but nothing changed