tags:

views:

109

answers:

4

Hi Folks,

So my user signs up from the Android App on his phone and after sign up is successful I trigger a mail to be sent to the signed up email address with an Activation Passcode from my PHP script. Here is the line of code that I use which is pretty trivial.

mail($to, $subject, $message, $headers);

The mail is sent correctly every time to the correct email address but the problem is the email shows up in Gmail or Hotmail or Yahoo in more than 10 minutes. That kind of a latency for receiving an Activation Code for the App "to me" is unacceptable.

What can reduce this latency and make this if not instanteneous but a lot quicker. Any ideas.

Thank you all for your help!!

A: 

Hi, most likely it is your server, perhaps you have a anti-spam program or anti-virus program? If you are on a shared environment there may be a que.

Darren
A: 

I'll guess you're using some shared hosting which probably is using some q system and therefor the delay... If your really picky about getting your mail delivered at once i would recommend dedicated hosting

Breezer
you could use curl to login to your email account and email your emails but that would require quite some coding from your side...if you decide to change provider may i recommend one.com quite cheap and fast used them for 3 years and they've never let me down
Breezer
I want to try curl before going for a dedicated server.
Aakash
+3  A: 

I had this issue with GoDaddy shared hosting, using their SMTP server. It was because the SMTP server was a shared, open relay, and with the volume of messages passing through it - there is a delay of roughly 10 minutes as well.

Are you on shared hosting/GoDaddy? What SMTP relay are you using?

EDIT: After researching this thoroughly very recently, I have found that there is no way to deliever a high quality of SMTP service (i.e. < 10 minutes for an email) to my audience on GoDaddy shared hosting. This is incredibly frustrating. Looks like the options are to buy dedicated hosting from GoDaddy (~$300/year), or to switch providers.

barfoon
I am on GoDaddy but how do I find out if it is Shared Hosting? Also where do I find the SMTP relay info? Except for the mail() function I am not using anything in the PHP script.
Aakash
You are right I am on Shared Hosting Godaddy (Linux).
Aakash
Is there a way this can be resolved?
Aakash
This is the response I got from GoDaddy:
barfoon
"At this time the only SMTP server available for use on our Hosting accounts is relay-hosting.secureserver.net. You would not be able to use GMail's outgoing server with our Shared Hosting accounts.  Additionally, as this is a shared SMTP server, it is not unusual to experience a slight delay in the sending of emails.  If these emails are being received within 60 minutes of their send time, this is within the acceptable time frames for a shared server.  If you experience delays longer than 60 minutes or errors associated with SMTP relaying, please reply back. "
barfoon
That makes sense. Now I understand what the delay is all about. Thanks for the clarification.
Aakash
+1  A: 

On top of everything else, the receiving end may be using greylisting, which basically bounces an email on the first delivery attempt, on the theory that spam sources won't bother retrying, while a legitimate server WILL re-try after a few minutes.

Marc B