Why is the Email Service so unreliable

193 views
Skip to first unread message

Jeff Gager

unread,
Nov 20, 2011, 1:33:46 PM11/20/11
to Google App Engine
I have written an app that sends email notifications to it's users
under some circumstances. Sometimes it works, other times it doesn't.
The code doesn't change and I am using the same small set of emails
addresses to send and receive emails so I can't see what I am doing
wrong.

When it fails I get exceptions that begin like this;

MessagingException: MailService IO failed (java.io.IOException:
Internal error)
javax.mail.SendFailedException: MailService IO failed
(java.io.IOException: Internal error)
at
com.google.appengine.api.mail.stdimpl.GMTransport.sendMessage(GMTransport.java:
253)
at javax.mail.Transport.send(Transport.java:95)
at javax.mail.Transport.send(Transport.java:48)
at com.hotf.server.EmailService$1.run(EmailService.java:119)

So I thought I would set up a deferred task queue and configure it to
keep trying every 15 minutes until it works.

Now emails fail with the same error for anything up to eight or nine
hours, then without reason or explanation the email service will
suddently start working and all the emails will be delivered.

I have searched through this group and found and number of people have
had problems but I don't think any of them apply to the testing I am
doing. I am sending from the email address of the apps administrator
account, I have no quotes in my email addresses etc...

The only lead I haven't followed up yet is that someone suggested the
email service is unreliable if you don't enable billing. So before I
take that step, can someone point out anything else I may be doing
wrong please.

My code is;

Properties props = new Properties();
Session session = Session.getDefaultInstance(props, null);

try {

Message msg = new MimeMessage(session);
msg.setFrom(new InternetAddress("X...@gmail.com", "SUBJECT"));
String email = a.getEmail().replace("\"","").replace("'", "").trim();
msg.addRecipient(Message.RecipientType.TO,new InternetAddress(email,
a.getName()));
msg.setSubject(subject);
msg.setText(body);
log.info("Sending notification email to " + email);
Transport.send(msg);

} catch (UnsupportedEncodingException e) {

log.log(Level.SEVERE, "MessagingException: " + e.getMessage(), e);
e.printStackTrace();
throw new RuntimeException(e);

} catch (AddressException e) {

log.log(Level.SEVERE, "MessagingException: " + e.getMessage(), e);
e.printStackTrace();
throw new RuntimeException(e);

} catch (MessagingException e) {

log.log(Level.SEVERE, "MessagingException: " + e.getMessage(), e);
e.printStackTrace();
throw new RuntimeException(e);

} catch (Exception e) {

log.severe(e.getMessage());
e.printStackTrace();
throw new RuntimeException(e);

Leandro Rezende

unread,
Nov 20, 2011, 1:57:59 PM11/20/11
to google-a...@googlegroups.com
i have the same problem. i just give up looking for a solution.

i hope this problem does not happen when i change my application to the billling status.

2011/11/20 Jeff Gager <jeff...@gmail.com>
--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.


Tapir

unread,
Nov 21, 2011, 3:01:53 AM11/21/11
to Google App Engine
"Now emails fail with the same error for anything up to eight or nine
hours, then without reason or explanation the email service will
suddently start working and all the emails will be delivered. "

The experience is much like mine. Sometimes every new member of my
website will activate their accounts,
but sometimes, none will activate their accounts.

Martin Waller

unread,
Nov 21, 2011, 4:21:09 AM11/21/11
to google-a...@googlegroups.com
Hi,

I've been trying out Amazom Web Services SES for the last week and it seems to be fine. It gives you so much more detail about mail send and mail that gets rejected. I'm going to stop using the GAE mail interface.

Martin

Martin Waller

unread,
Nov 21, 2011, 4:41:48 AM11/21/11
to Google App Engine
I forgot to add that we now pay for this service and if we are finding
it to be failing us then we really should be getting a refund!

Martin

On Nov 21, 9:21 am, Martin Waller <nettrekk...@gmail.com> wrote:
> Hi,
>
> I've been trying out Amazom Web Services SES for the last week and it seems to be fine. It gives you so much more detail about mail send and mail that gets rejected. I'm going to stop using the GAE mail interface.
>
> Martin
>
> On 20 Nov 2011, at 18:57, Leandro Rezende wrote:
>
>
>
>
>
>
>
> > i have the same problem. i just give up looking for a solution.
>
> > i hope this problem does not happen when i change my application to the billling status.
>

> > 2011/11/20 Jeff Gager <jeffga...@gmail.com>

> > For more options, visit this group athttp://groups.google.com/group/google-appengine?hl=en.

PK

unread,
Nov 21, 2011, 11:33:25 AM11/21/11
to google-a...@googlegroups.com
I want to add my experience here which happens to be positive. I have been finding the e-mail service very reliable. A couple of data points:

1. I use python.
2. With the current load, the service only sends  about 100-500 e-mails per day, often in batches of 50-100.

With this configuration I have had very happy customers for a couple of years now. In fact, everybody assumes that e-mails will be delivered instantaneously, so the only one time that e-mails were queued for several hours we all panicked...

Having said that, some more visibility on where the e-mails are before they leave the Google infrastructure would be welcome for the rare cases when the customer calls and says: "my e-mails were not received".

PK
http://www.gae123.com

Tapir

unread,
Nov 21, 2011, 12:26:55 PM11/21/11
to Google App Engine
Hi PK,
how you know the service only sends about 100-500 e-mails per day.
and how do you know if your customers have received your mails or not?

PK

unread,
Nov 22, 2011, 2:59:16 AM11/22/11
to google-a...@googlegroups.com
Hi Tapir,

I keep my statistics on how many emails my service sent and correlate them with the numbers reported by GAE. Of course, I do not know if every e-mail was received but I have not heard a single complaint from the customers of my customers that e-mails were nor delivered. In fact, given how unreliable e-mail is to start with, I am surprised how good my experience has been.

Best,
PK

Tapir

unread,
Nov 22, 2011, 11:32:14 AM11/22/11
to Google App Engine
Sometimes, the feeling is fake. :)

Jeff Gager

unread,
Nov 22, 2011, 5:25:06 PM11/22/11
to Google App Engine
Thanks very much to everyone who replied.

Really interesting that PK is getting such a good service on python,
that's really good news and indicates that the service can and
ultimately will work well in Java to.

Martin do you use Java? If you have enabled billing and you are still
getting a poor service then it looks like there is no point in me
throwing money into the pot to solve the problem with the Java Mail
Service until Google get it working properly.

In the mean time I will have a look at SES.

- Jeff

Jeff Gager

unread,
Nov 26, 2011, 10:03:43 AM11/26/11
to Google App Engine
Found the following issue raised and added a link to this thread.

http://code.google.com/p/googleappengine/issues/detail?id=5776&can=5

- Jeff

Reply all
Reply to author
Forward
0 new messages