List of all Iphone and Blackberry Development codes in a one click Iphone,objective C,xcode,blackberry Development,iOS Development

Monday, April 16, 2012

Send Email in Blackberry





  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();
           }





        

1 comment:

  1. do you want to specify the host name ? because this code does not work it show exception: exceptionnet.rim.blackberry.api.mail_SendFailedException:MAIL_API: No RIM Service Record

    ReplyDelete