Arash Emadi
Arash Emadi

Reputation: 21

Why isn't my CodeIgniter app sending emails on smtp?

I'm trying to send mail using CodeIgniter. I don't get any errors; in fact I get the success message designed in the system, but the email won't go through. The form details, however, get recorded in my database. Can you help me fix this please? Thanks in advance.

I'm trying to send the mail using a GoDaddy shared hosting by the way.

Here's my email.php configuration:

<?php

        $config = array(

          'protocol' => 'smtp',
          'smtp_host' => 'server',
          'smtp_port' => 80,
          'smtp_timeout' => 7,
          'smtp_user' => 'blabla', 
          'smtp_pass' => 'blabla', 
          'mailtype' => 'html',
          'charset' => 'utf-8',
          'newline' => "\r\n",
          'wordwrap' => TRUE

        );?>

Upvotes: 1

Views: 343

Answers (2)

Dustin Luke
Dustin Luke

Reputation: 21

GoDaddy has a tendency to lock down alot on their shared hosting. There is a similar Stack Overflow answer here:

https://stackoverflow.com/questions/13219209/codeigniter-email-class-with-godaddy-email-hosting-issues

Another option is using a third party SMTP service. I have GoDaddy hosting myself and I use SMTP2Go.

I had to use port80.smtpcorp.com as my host and port 443.

Hope that information helps!

Upvotes: 2

Thalia
Thalia

Reputation: 19

SMTP ports are usually 25, 2525, or 587. Changing your SMTP port number should fix your problem.

Upvotes: 2

Related Questions