Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8259177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:47:54+00:00 2026-06-08T02:47:54+00:00

I am developing an app where i need to send email from my app.

  • 0

I am developing an app where i need to send email from my app. I want to send email when button was clicked in my app. I executed the sample code given by Blackberry “blackberrymaildemo” but email is not sending from device & not getting any errors or exceptions also. I executed the following
Blackberry – How to send email using RIM API Tutorial
but not getting any idea how the code is running after app is launched as getting only blank screen & not getting any idea how to send email by the following code.

code:

    package mypackage;

   import net.rim.device.api.ui.component.ButtonField;
   import net.rim.device.api.ui.container.MainScreen;
   import net.rim.blackberry.api.mail.Address;
   import net.rim.blackberry.api.mail.Folder;
   import net.rim.blackberry.api.mail.Message;
   import net.rim.blackberry.api.mail.MessagingException;
   import net.rim.blackberry.api.mail.Session;
   import net.rim.blackberry.api.mail.Store;
   import net.rim.blackberry.api.mail.Transport;


 public final class MyScreen extends MainScreen
 {
/**
 * Creates a new MyScreen object
 */
public MyScreen()
{        
    // Set the displayed title of the screen       
    setTitle("MyTitle");
    ButtonField btn = new ButtonField();
    btn.setLabel("Button Click");
    add(btn);

    try
    {
   Session session=Session.getDefaultInstance();
   Store store=session.getStore();

   Folder[] folders_list =store.list(Folder.SENT);
   Folder folder_sent = folders_list[0];

   Message message=new Message(folder_sent);

   message.setSubject("This is Test message");


    message.setContent("hi! this is test email from BB");


   Address recs[] = new Address[2];
   recs[0] = new Address("xxxxxx@gmail.com", "raghu b");
   recs[1] = new Address("xxxxxx@gmail.com", "b raghu");

   message.addRecipients(Message.RecipientType.TO, recs);


   Transport.send(message);

    }catch (MessagingException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }


  }
 }

As i am new to this Blackberry development, i am unable get the code for sending email. Can anyone please help me with this.

When share via email button was clicked then the code of email needs to be invoked and my another doubt is can we send email or sms from blackberry simulator to another blackberry simulator/device…?

Thanks in advance……….

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T02:47:56+00:00Added an answer on June 8, 2026 at 2:47 am

    Try this code –

    Address recipients[] = new Address[1]; 
    Store store = Session.getDefaultInstance().getStore(); 
    Folder[] folders = store.list(Folder.SENT); 
    Folder sentfolder = folders[0]; 
    Message msg = new Message(sentfolder); 
    
    try 
        { 
            recipients[0]= new Address("Email id","Name"); 
            //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("123456789---------------"); 
            //sets priority 
            msg.setPriority(Message.Priority.HIGH); 
            //send the message 
            Transport.send(msg); 
          } 
    
          catch (Exception me) 
          { 
    
            System.err.print(me); 
          }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In an iPhone app I'm developing, I need to send an email programmatically (read,
i am developing and app for blackberry and i need to send a Http
I am developing an app where iphone and android phones need to send requests
I'm developing a iPhone app and need to send it to my client. In
I am developing this app and i need at some point to send data
I'm developing an app in Android and I need to traverse a xml file.
I am developing an app in Cocoa. I need to show a progress at
I'm developing an app in php, and I need to set up a pretty
I am developing an IOS app. I need a functionality that includes undo and
I'm developing an android app, and I need to have a json response of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.