BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 08-25-2008, 04:26 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Jul 2008
Model: 8310
PIN: N/A
Carrier: ddd
Posts: 18
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default SendEmail

Please Login to Remove!

Hi i trying to send a email using this code:

public class enviamail extends Application {

public static void main(String[] args) {
new enviamail().enterEventDispatcher();
}

public enviamail() {
Address a;
Store store = Session.getDefaultInstance().getStore();
Folder[] folders = store.list(Folder.SENT);
Folder sentfolder = folders[0];
Message m = new Message(sentfolder);

try {
a = new Address ("xxxx@mpginfo.com", "xxxx@mail.mpginfo.com");
Address[] addresses = {a};
m.addRecipients(Message.RecipientType.TO, addresses);
m.setContent("Contenido del email");
m.setSubject("GPS Tracking Test");
Transport.send(m);
}
catch (Exception me) {
System.err.println(me.getMessage());
}

}
}

but a nullpointerexception i found. Somebody know why?
Somebody know Debug blackberry applications wich Eclipse? I found a error: source file no found.
Offline  
Old 08-25-2008, 09:23 AM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: Apr 2006
Location: Boston
Model: 8900
Carrier: AT&T
Posts: 98
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

So where is the null exception happening? Are you running in a simulator or on a real device?
__________________
Karl G. Kowalski
---------------
Owns a RAZR
Develops for BlackBerry
So next phone will be........an iPhone 3G!
Offline  
Old 08-25-2008, 12:52 PM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Jul 2008
Model: 8310
PIN: N/A
Carrier: ddd
Posts: 18
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, is a real device. The problem was that i had not create a email account in the device.
Offline  
Old 08-26-2008, 05:04 AM   #4 (permalink)
Thumbs Must Hurt
 
Join Date: Apr 2006
Location: Boston
Model: 8900
Carrier: AT&T
Posts: 98
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ah yes, that would tend to have that effect. Good work finding it!

Cheers,

karl
__________________
Karl G. Kowalski
---------------
Owns a RAZR
Develops for BlackBerry
So next phone will be........an iPhone 3G!
Offline  




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