BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 07-14-2011, 02:41 AM   #1 (permalink)
New Member
 
Join Date: Jun 2011
Model: 9800
PIN: N/A
Carrier: none
Posts: 8
Post Thanks: 1
Thanked 0 Times in 0 Posts
Default Sending E-mail from BB simulator 9800, urgent help

Please Login to Remove!

hai friends...!

i have to send the order details via e-mail from the simulator as part of my project..!

here is my code:

Store store = Session.getDefaultInstance().getStore();
Folder[] folders = store.list(Folder.SENT);
Folder sentfolder = folders[0];
Message msg = new Message(sentfolder);

Address tolist = null;
try
{
//Address tolist[] = new Address[1];
tolist = new Address(objTo.getChoice(objTo.getSelectedIndex()). toString(), "");
}
catch(AddressException e)
{
System.out.println(e.toString());
}
try
{

msg.addRecipient(Message.RecipientType.TO, tolist);
}
catch (MessagingException e)
{
System.out.println(e.toString());
}

if(!objCc.getChoice(objCc.getSelectedIndex()).toSt ring().equals(""))
{
Address cclist = null;
try
{
//Address tolist[] = new Address[1];
cclist = new Address(objCc.getChoice(objCc.getSelectedIndex()). toString(), "");
}
catch(AddressException e)
{
System.out.println(e.toString());
}
try
{
msg.addRecipient(Message.RecipientType.CC, cclist);
}
catch (MessagingException e)
{
System.out.println(e.toString());
}
}

if(!objBcc.getChoice(objBcc.getSelectedIndex()).to String().equals(""))
{
Address bcclist = null;
try
{
//Address tolist[] = new Address[1];
bcclist = new Address(objBcc.getChoice(objBcc.getSelectedIndex() ).toString(), "");
}
catch(AddressException e)
{
System.out.println(e.toString());
}
try
{
msg.addRecipient(Message.RecipientType.BCC, bcclist);
}
catch (MessagingException e)
{
System.out.println(e.toString());
}
}

try
{
Address from = new Address("my email address", "my name");
msg.setFrom(from);
}
catch(AddressException e)
{
System.err.println(e.getMessage());
}

try
{
msg.setSubject(bsSubject.getText());
msg.setContent(txtBody.getText());
Transport.send(msg);
Status.show("message sent", 1500);
UiApplication.getUiApplication().popScreen(UiAppli cation.getUiApplication().getActiveScreen());
}
catch(MessagingException m)
{
System.err.println(m.getMessage());
}


when i debug the code,the code is working properly...! code is executing line by line in a proper manner..!

but the email has not been delivered to the To, Cc,Bcc addresses.

could you anyone please help on this issue? i have tested in BB Simulator 9800, using Eclipse plug-in.

i opened my mail account from the BB simulator's default browser, and was able to send the e-mail to another address.

thanks!
Offline  
Old 07-14-2011, 06:16 AM   #2 (permalink)
New Member
 
Join Date: Jun 2011
Model: 9800
PIN: N/A
Carrier: none
Posts: 8
Post Thanks: 1
Thanked 0 Times in 0 Posts
Default Re: Sending E-mail from BB simulator 9800, urgent help

please tell me that "is it possible to send email from my application to some yahoo mail ids"? that all i wanted to know.

bz i hav gone through the blackberry developer's guide chapter 2 (Integrating email), it says the code for sending email.

or do we need to have any alliance with RIM to use the email service? the code segment i posted above is executing without exception but email has not been sent.

i m expecting an urgent reply since i want to finish my project.

thanks again..!
Offline  
Old 07-14-2011, 07:29 AM   #3 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default Re: Sending E-mail from BB simulator 9800, urgent help

In order to send email from the simulator, you need to set up your SMTP mail service account information in the rimpublic.properties file. You'll find this in the simulator directory.

(not sure about the file name, this is from memory).
Offline  
Old 07-14-2011, 12:22 PM   #4 (permalink)
New Member
 
Join Date: Jun 2011
Model: 9800
PIN: N/A
Carrier: none
Posts: 8
Post Thanks: 1
Thanked 0 Times in 0 Posts
Default Re: Sending E-mail from BB simulator 9800, urgent help

thanx for ur reply..!

i found it in the config directory. it says as follows

#Email.mode =standalone
#Email.mode =connect
Email.mode =none

#Common settings for both standalone and connect mode
Email.personal =Test User
Email.address =myemail@mycompany.com
Email.deviceId =2100000a

#Connect mode settings
Email.pop3Server =popServer
Email.smtpServer =smtpServer
Email.smtpPort =25
Email.pop3Port =110

could you please tell me how to set up the SMTP service account as you mentioned earlier

thanx,
Offline  
Old 07-14-2011, 03:56 PM   #5 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default Re: Sending E-mail from BB simulator 9800, urgent help

Change to email.mode to "Connect" mode, then put your POP and SMTP mail server info in the appropriate properties.

I don't know your account info, so you'll have to figure it out.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads for: Sending E-mail from BB simulator 9800, urgent help
Thread Thread Starter Forum Replies Last Post
Help understand output from messageflow.exe in BB ressource kit RonnieArrowECS BES Admin Corner 1 11-03-2011 12:41 PM
Sending E-mail from BB simulator 9800, urgent help asriragu General BlackBerry Discussion 3 07-14-2011 06:40 AM
Real BB Mail Address? for Newbie savin2 General BlackBerry Discussion 5 08-03-2009 01:23 PM
E Mail Management between Laptop & BB Capt Desikan General BlackBerry Discussion 4 07-10-2008 09:17 AM
Not sending mail paulpr90 General Legacy Device Discussion 0 10-03-2005 11:48 AM





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.