BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 08-25-2008, 04:26 AM   #1
danietepa
Knows Where the Search Button Is
 
Join Date: Jul 2008
Model: 8310
PIN: N/A
Carrier: ddd
Posts: 18
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
holy3daps
Thumbs Must Hurt
 
Join Date: Apr 2006
Location: Boston
Model: 8900
Carrier: AT&T
Posts: 98
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
danietepa
Knows Where the Search Button Is
 
Join Date: Jul 2008
Model: 8310
PIN: N/A
Carrier: ddd
Posts: 18
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
holy3daps
Thumbs Must Hurt
 
Join Date: Apr 2006
Location: Boston
Model: 8900
Carrier: AT&T
Posts: 98
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  
Closed Thread



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


DAYTON SOLENOID COIL 6X542 24 VOLT picture

DAYTON SOLENOID COIL 6X542 24 VOLT

$52.00



Utility Aluminum Trim Coil 24

Utility Aluminum Trim Coil 24" x 40-45 FT Long with Minor Scratches and Dents

$84.95



Ignition Coil for Ford Tractor 12V 2000 3000 4000 5000 Naa600 800 1965 & Up D5TE picture

Ignition Coil for Ford Tractor 12V 2000 3000 4000 5000 Naa600 800 1965 & Up D5TE

$26.38



Dual Purpose Manual Coil Counting Winding Machine Coiler Count Range 0-99999 NEW picture

Dual Purpose Manual Coil Counting Winding Machine Coiler Count Range 0-99999 NEW

$39.05



D4PE12029AA 6 Volt Ignition Coil Fits Ford/New Holland Tractor 600 700 800 picture

D4PE12029AA 6 Volt Ignition Coil Fits Ford/New Holland Tractor 600 700 800

$26.44



Red Top Ignition Coil Packs UF483 UF411 06C905115A 06A905115 Set of picture

Red Top Ignition Coil Packs UF483 UF411 06C905115A 06A905115 Set of

$46.38







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