Java 谷歌应用程序迁移API批处理不';t发送/插入电子邮件
我正在尝试使用Google Apps Migration API v.1发送电子邮件,但是我没有发送它们,代码也没有抛出任何异常或错误。 这是我的密码:Java 谷歌应用程序迁移API批处理不';t发送/插入电子邮件,java,google-app-engine,gwt,google-email-migration,Java,Google App Engine,Gwt,Google Email Migration,我正在尝试使用Google Apps Migration API v.1发送电子邮件,但是我没有发送它们,代码也没有抛出任何异常或错误。 这是我的密码: MailItemService mailItemService = new MailItemService("exampleCo-exampleApp-1"); mailItemService.setUserCredentials("user","password"); MailItemEntry entry =
MailItemService mailItemService = new MailItemService("exampleCo-exampleApp-1");
mailItemService.setUserCredentials("user","password");
MailItemEntry entry = new MailItemEntry();
Rfc822MediaSource mediaSource = new Rfc822MediaSource(mail.getInputStream().toString());
entry.setMediaSource(mediaSource);
entry.addMailProperty(MailItemProperty.STARRED);
entry.addMailProperty(MailItemProperty.UNREAD);
entry.addLabel(new Label("pruebas"));
MailItemFeed feed = new MailItemFeed();
for (int i = 0; i < mailItems.size(); i++) {
BatchUtils.setBatchId(mailItems.get(i), Integer.toString(i));
feed.getEntries().add(mailItems.get(i));
}
mailItemService.batch("domain", "destinationUser", feed);
MailItemService MailItemService=newmailitemservice(“exampleCo-exampleApp-1”);
setUserCredentials(“用户”、“密码”);
MailItemEntry=新的MailItemEntry();
Rfc822MediaSource mediaSource=新的Rfc822MediaSource(mail.getInputStream().toString());
entry.setMediaSource(mediaSource);
entry.addMailProperty(MailItemProperty.STARRED);
entry.addMailProperty(MailItemProperty.UNREAD);
条目。添加标签(新标签(“pruebas”);
MailItemFeed=新的MailItemFeed();
对于(int i=0;i
你能定义一下“发送”是什么意思吗?除了将旧邮件迁移到邮箱(例如,不允许执行常规的新邮件邮箱插入)之外,将其用于任何其他用途都是违反API ToS的。如果您试图向邮箱发送新邮件,请使用
杰伊