-3

我正在显示一个包含一些文本和一个图像的页面。我想通过电子邮件将此页面的 URL 发送给一些朋友。这个怎么做?

4

1 回答 1

1

检查这个 -

 Store store = Session.getDefaultInstance().getStore();
 Folder[] folder = store.list(Folder.SENT);
 Folder sent = folder[0];
 Message msg = new Message(sent);
 Address receipent[] = new Address[1];
 try
    {
     receipent[0] = new Address(To_Address, name);
     msg.addRecipients(Message.RecipientType.TO, receipent);
     msg.setSubject("Test Mail");
     msg.setContent("This mail is to remind you that programmatically we can send the mail");
     msg.setPriority(Priority.HIGH);
     Transport.send(msg);
    }

  catch (Exception e)
         {
                e.printStackTrace();
          }
于 2012-09-24T09:02:26.257 回答