Email sending takes 36 seconds! |
[eluser]dobbler[/eluser]
Hi, I'm writing a password reset function where the new password gets sent via email. Here is the code: Code: $this->load->library('email'); I've tried no config, which I presume defaults to the mail protocol and config with sendmail but both are really really slow 28 seconds & 36 seconds respectively. I'm currently testing on a temporary server so I don't have access to smtp properly yet. Is there something I'm missing? Thanks.
[eluser]xwero[/eluser]
are you talking about the mail going from php to the mailserver or from the mailserver to actually sending the mail? E-mail is not an instant communication service. So you are not getting your email as soon as you send it.
[eluser]dobbler[/eluser]
Thanks xwero, but I'm not that impatient! No, the page is freezing upon submission of the form for up to 40 seconds. Then it goes to the success page and the mail gets sent so the whole thing is working but that freeze is not cool because nothing is happening for the user.. Any thoughts?
[eluser]xwero[/eluser]
Add benchmarks markers where you think the problem is. For example Code: $this->benchmark->mark('to_class');
[eluser]dobbler[/eluser]
Hi zwero, Thanks for your reply. Here's what I got from the benchmark test: ('to_class', 'to_server') = 0.0000 ('to_server', 'done') = 32.7540 So it seems clear that it's the $this->email->send(); that's taking the time. God knows why it's taking that long.. Thanks for your help so far, any ideas? Anyone??
[eluser]xwero[/eluser]
Have you tried using a public mail server to send a test mail? I think the problem has to be with your server. I saw a few other posts where it was mentioned the email class was slow but half a minute page freeze is long. Maybe you should use an of the shelf library like swift mailer for emailing.
[eluser]dobbler[/eluser]
I had planned on using phpMailer to handle the more intensive emailing but for cheap & nasty single emailing I was hoping the email class would handle it. Either way, I think you're right that it's something to do with the server. Thanks again for your time & help. Btw, would u recommend swiftmailer over Phpmailer and for any particular reason? I guess it comes down to personal preference in the end..
|
Welcome Guest, Not a member yet? Register Sign In |