Thursday, April 8, 2010

How to send email in BlackBerry Simulator

Recently I am working on a BlackBerry Email app, I need to setup a test environment so I can test mail send in the BlackBerry simulator.
I did some research, I read the RIM related document it does not help, then I find a solution from a good book about blackberry - Advanced BlackBerry Development, by Chris King.
I just follow the method from the book , and finally get it working, the solution is quite straight forward.

You need BlackBerry ESS ( Email Server Simulator) in order to simulate mail from your simulator, it comes with the JDE SDK and JDE component, currently I used JDK 4.5 , I prefer it because it's simulator is much faster to launch.


There are two mode you can choose - Connected mode or Standalone mode.
I tired the connected mode, it does not working.
The book recommend using the Standalone mode:  ESS will listen the localhost port, send out email to your smtp email client. If you set up your email client, choose localhost as server address, and configure the same pop3 and smtp port as ESS configured, your email client will receive the email.
 Choose "Standandalone mode",  set Pop3 port and Smtp port,  I choose default value, which are 995 and 465.
Click Launch, the ESS will start, and you will say a dos command window displaying the server log information.

Then we need to configure your email client,  I choose OutLook Express.
Add a new account,  you can set up any email address,
Set localhost  for both SMTP and POP3 server.
for POP3 port number ,use the same value of ESS: 465
for SMTP port number, use the same value of ESS:995


So far the configuration is finished, all you can do is launching the simulator.
You can start the blackberry email client, type any address,  then send.  Check your OutLook Express, you will find an incoming email.
And you can write an email from your outlook express, type any address, then send it.  You will find the email in your blackberry simulator.
The only drawback is you can only send and receive email from your local machine. which is not real, but it is good enough to test the mail function in the simulator.
It is really good, I tested over 100 email using the solution above.
Finally I want to talk about a little about the book, it covers many good topics, such as BES, BIS which confuses me for a long time.  Even I haven't finished it, but I think it is one of the best  blackberry book so far.

3 comments:

  1. Hi .

    I have BB os 5.0 and 6.0 simulators. How do I configure email?

    regards,
    Ian

    ReplyDelete
  2. Can you give me the link for download blackberry ess?

    ReplyDelete