我已经在周末玩Google App Engine和Google Web Toolkit,并且相处得很好,并且构建了一个简单的应用。Google应用引擎不会发送邮件,尽管呼叫出现在配额详细信息中
绊脚石似乎在发送电子邮件。我的代码是:
private void sendOffenderMail(OffenceDetails offence)
{
if(offence.email == null || offence.email.equals(""))
{
return;
}
Properties props = new Properties();
Session session = Session.getDefaultInstance(props, null);
String msgBody = "You have been added to the list";
if(offence.notes != null && !offence.notes.equals(""))
{
msgBody += "\n\nThe following notes were included:\n\n" + offence.notes;
}
Message msg = new MimeMessage(session);
try {
msg.setFrom(new InternetAddress(<gmail account belonging to project viewer>, "List Admin"));
msg.addRecipient(
Message.RecipientType.TO,
new InternetAddress (offence.email, offence.name)
);
msg.setSubject("You've been added to the list...");
msg.setText(msgBody);
Transport.send(msg);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (MessagingException e) {
e.printStackTrace();
}
}
当我在开发服务器日志获得关于将已发送邮件打印到控制台上进行运行此。 当我部署到应用引擎并尝试没有任何反应时,我没有收到任何邮件。
如果我查看配额详情,我可以在那里看到邮件API调用。如果我查看日志,则没有错误(但我无法看到和我的日志在那里...)。
似乎很奇怪,我基本上被指控发送这个(配额用完),但没有邮件实际上通过。
我已经检查了我的垃圾邮件文件夹BTW。
我尝试将帐户的所有者更改为开发人员(尽管实际上并未在文档中找到该位,但它只是表示管理员相信查看者),但电子邮件仍未发送。 无论如何,谢谢 – Roaders 2013-02-19 13:19:18