BlackBerry
Skip Top Navigation
Developers Partners
North America [change region] Products Solutions Purchasing Support
Developers


Sending Email Messages

Exercise

Write an application that sends email messages.

Objectives

  • Discover how to send an email message.
  • Discover how to receive an email message.
  • Discover how to use the email server simulator (ESS).

Setup

  1. Download the file
  2. In the IDE, open the email_sample.jdw workspace
  3. Open the EmailSample.java source file.

Tasks

  1. Add code to _sendItem to complete the following tasks:
    1. retrieve a reference underlying message storage
    2. retrieve a reference to the Sent Items folder
    3. create the message
    4. add the email recipient (retrieve the address that the user entered)
    5. add the subject (retrieve the subject that the user entered)
    6. add the body (retrieve the message text that the user entered)
    7. send the message
    8. reset UI fields to empty
  2. Start the email server simulator in standalone mode.
  3. Start Microsoft Outlook Express.
  4. Build and run the application in the simulator.
  5. Verify that the email message appears in Outlook Express.

Check Your Work

Download the completed code

Review

In this exercise, you discovered the following things:

  • how to create and send an email message
  • how to use the email server simulator to test email functionality


Additional Resources

Go to the next exercise in “Connecting to Email, Calendar and PIM Applications on BlackBerry”, Using PIM functions

Back to the Developer Lab Main Menu

 
Other Resources
 
     
 Home | Products | Solutions | Purchasing | Support | Developers | Worldwide | News | About Us | Contact Us | Site Map
 Legal | Copyright © 2008 Research In Motion Limited, unless otherwise noted.