Search This Blog

Tuesday, 1 January 2013

How to send Email from your app in Blackberry

Hello friends,
                     Here is the code for sending automated  email from your blackberry App :)


CODE:


Message msg = new Message();
Address receipients[] = new Address[1];
try{
receipients[0] = new Address("user@abc.com","user");//two paramters i .e email id and name.
msg.addRecipients(Message.RecipientType.TO, receipients);

msg.setSubject("Testing subject");
msg.setContent("This is a test mail.");
msg.setPriority(Message.Priority.HIGH);
Transport.send(msg);


}catch(Exception e){

System.out.println("Error: "+e.toString());

}


Regards.

No comments:

Post a Comment