Create a new populated email message

  1. Import the required classes and interfaces.
    import net.rim.blackberry.api.invoke.Invoke;
    import net.rim.blackberry.api.invoke.MessageArguments;
    import net.rim.blackberry.api.mail.Address;
    import net.rim.blackberry.api.mail.Message;
  2. Create and populate a new email Message object.
    Message m = new Message();
    Address a = new Address("", "Ming Li");
    Address[] addresses = {a};
    m.addRecipients(net.rim.blackberry.api.mail.Message.RecipientType.TO, addresses);
    m.setContent("A message for you...");
    m.setSubject("Email for you");
  3. Invoke Invoke.invokeApplication()with the following parameters:
    • a MessageArguments object that uses the new Message object.
    Invoke.invokeApplication(Invoke.APP_TYPE_MESSAGES, new MessageArguments(m));

Was this information helpful? Send us your comments.