简体   繁体   English

MailService IO失败(java.io.IOException:内部错误)

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

I am getting the below error when sending emails in GAE. 在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) MailService IO失败(java.io.IOException:内部错误)

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. 经过一番调查,我发现了这个GAE问题: http : //code.google.com/p/googleappengine/issues/detail? id= 5776 ,它表明GAE实例ID不应与发件人电子邮件ID相同。 For example, in "abcd.appspot.com", when the sender ID is "abcd@xxxx.com", it would fail to send email. 例如,在“ abcd.appspot.com”中,当发件人ID为“ abcd@xxxx.com”时,它将无法发送电子邮件。

I haven't tried it yet, but I'm sure I used same IDs in my error case. 我还没有尝试过,但是我确定我在错误情况下使用了相同的ID。 I will test it tomorrow and update this post about wether it works or not. 我明天将对其进行测试,并更新此帖子以了解它是否起作用。

Thanks, J 谢谢,J


Update [Dec 15, 2011 GMT+8]: 更新[2011年12月15日GMT + 8]:

I tried it but still has problems, so I posted comments to the following GAE issues: 我尝试过,但仍然有问题,因此我对以下GAE问题发表了评论:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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