【问题标题】:How to test sending email in blackberry eclipse plugin 1.1如何在黑莓eclipse插件1.1中测试发送电子邮件
【发布时间】:2011-08-05 19:15:15
【问题描述】:

嗨朋友们,我使用下面的代码发送邮件。 我在 JDE5.0 中使用 ESS 对其进行了测试,但它不起作用。 所以请给我一些解决方案。

导入 net.rim.blackberry.api.mail.; 导入 net.rim.blackberry.api.mail.event.; 导入 net.rim.device.api.system.*; 公共类 BasicMail 扩展应用程序 { 私人商店商店; 静态无效主要(字符串参数 []){ BasicMail app = new BasicMail("a"); app.enterEventDispatcher(); } 基本邮件(字符串 s) { //从默认邮件Session中获取Store。 Store store = Session.getDefaultInstance().getStore();

//检索发送的文件夹 文件夹[] 文件夹 = store.list(Folder.SENT); 文件夹 sentfolder = 文件夹[0];

//创建一条新消息并将其存储在已发送的文件夹中 消息消息 = 新消息(已发送文件夹); 地址收件人[] = 新地址[1];

试试{ 收件人[0]=新地址(“poovavin@gmail.com”,“poovannan”);

  //add the recipient list to the message
  msg.addRecipients(Message.RecipientType.TO, recipients);

  //set a subject for the message
  msg.setSubject("Test email");

  //sets the body of the message
  msg.setContent("This is a test email from my BlackBerry Wireless Handheld");

  //sets priority
  msg.setPriority(Message.Priority.HIGH);

  //send the message
  Transport.send(msg);

} 抓住(我除外){ System.err.println(me); } }

}

【问题讨论】:

    标签: blackberry-eclipse-plugin


    【解决方案1】:

    访问下面的链接,这将对您有所帮助。

    http://www.codinguru.com/2011/08/sending-email-with-attachment-in.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-22
      • 2015-07-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多