简体   繁体   中英

MailService IO failed (java.io.IOException: Internal error)

I am getting the below error when sending emails in GAE. This stopped working all of a sudden. Can someone help me understand where the problem might be or any debugging ideas would be appreicated. As you can see from the attached image I am well withing my quota.

MailService IO failed (java.io.IOException: Internal error)

public boolean email(final Player to, List<Player> players)
    {
        Properties props = new Properties();
        Session session = Session.getDefaultInstance(props, null);

        try
        {
            Message msg = new MimeMessage(session);
            msg.setFrom(new InternetAddress("validemail@gmail.com"));
            msg.addRecipient(Message.RecipientType.TO, new InternetAddress(to.getEmail()));
            msg.addRecipient(Message.RecipientType.CC, new InternetAddress("arav@yahoo.com"));
            msg.addRecipient(Message.RecipientType.CC, new InternetAddress("validemail@gmail.com"));

            msg.setSubject("Registration confirmation.");

            msg.setText("tx for registering");
            logger.info("sending email to " + to.getEmail());
            logger.info(msgBody.toString());
            Transport.send(msg);
            logger.info("sent email to " + to.getEmail());
        }
        catch (AddressException e)
        {
            return false;
        }
        catch (MessagingException e)
        {
            return false;
        }
        return true;
    }

在此处输入图片说明

I encountered exactly the same problem tonight. After some investigation, I found this GAE issue: http://code.google.com/p/googleappengine/issues/detail?id=5776 , which indicated that the GAE instance ID should not be the same as the sender email ID. For example, in "abcd.appspot.com", when the sender ID is "abcd@xxxx.com", it would fail to send email.

I haven't tried it yet, but I'm sure I used same IDs in my error case. I will test it tomorrow and update this post about wether it works or not.

Thanks, J


Update [Dec 15, 2011 GMT+8]:

I tried it but still has problems, so I posted comments to the following GAE issues:

http://code.google.com/p/googleappengine/issues/detail?id=5776 http://code.google.com/p/googleappengine/issues/detail?id=5320

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM