CodeIgniter Forums
Email Class takes hours to send email - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Email Class takes hours to send email (/thread-43576.html)



Email Class takes hours to send email - El Forum - 07-16-2011

[eluser]Unknown[/eluser]
Hi,

So we are using the email class to send emails such as verification emails, welcome emails, etc.

The problem is, the verification email takes too long to get received by our users- some users have reported waiting 4 hours to get it while others it took them an hour. I really don't know what could be causing this, majority of our vars are default.

Heres the emailing code;
Code:
$email = $this->User->get_email_by_hash($hash);
                $this->load->library('email');
                    
                $config['mailtype'] = 'html';
                
                $this->email->initialize($config);
                $this->email->from('[email protected]', 'Website');
                $this->email->to($email);    
                $this->email->subject('Welcome to Website');
                $this->email->message('HTML EMAIL HERE');    
    
                $this->email->send();

Could this be a host issue? We are hosted with MediaTemple.

Also we have tested it ourselves locally and it takes seconds, but when on our server sometimes it takes an hour.


Email Class takes hours to send email - El Forum - 07-16-2011

[eluser]Eric Barnes[/eluser]
It could be the domain, hosting, or mx records. Sometimes with shared hosting you can be on the same ip as a spammer. For DNS you can try something like: http://www.mxtoolbox.com/

I would probably contact your host though as this is outside of the framework itself.


Email Class takes hours to send email - El Forum - 07-17-2011

[eluser]Unknown[/eluser]
Thanks for the reply.

I am using a virtual private server so it is not shared. I have contacted my host and awaiting reply.

I used the tool you posted, everything is ok, except when i did a blacklist check;
CYBERLOGIC TIMEOUT ERROR, Reponse code=2
SPAMRBL TIMEOUT ERROR, Reponse code=2