BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 07-13-2007, 04:40 AM   #1
GERMartin
Knows Where the Search Button Is
 
Join Date: Jul 2007
Model: 8800
PIN: N/A
Carrier: Vodafone
Posts: 29
Default <Newbie> Send a Mail

Please Login to Remove!

Hello,

I'm in a practical course(in german Praktikum) and there is my Project to write a Programm which will send a E-Mail to a Mailaccount(always the Same account).
There should be only a few EditFields to type some things from the costumer.

There are now some problems. The first I did never used Java before. (only Delphi and C++).

and the Second the JavaCode.
I tried to use the simple HelloWorld Project for my Project.
I use the JDE in version 4.2.1. Here my Code Part for trying to send a Mail.

Code:
package ProjectHello;
import java.lang.*;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
import net.rim.blackberry.api.mail.*;


class HelloScreen extends MainScreen

{
    
    public EditField T1= new EditField(); 
    public EditField T2= new EditField();
    public HelloScreen()
    {
        super();
        LabelField title = new LabelField("Hallo du welt");
        this.setTitle(title);
        this.add(T1); 
        this.add(T2);
    }
    
    public String MailBody;
    public Message mail = new Message();
    public Address test = Address("Jagge1988@yahoo.de","Praktikant Martin"); ;
    public boolean onClose()
    {
            mail.addRecipient(EMAIL_ADDR,test);//error: cannot resolve symbol
            mail.setSubject("blubb");
            MailBody = new String();
            MailBody = "blaaa " + T1.getText() + " blaaablubb " + T2.getText();
            mail.setContent(MailBody);   
            mail.setStatus(TX_SENDING ,TX_ERROR);//2times error: cannot resolve symbol//Don't know about That
            Dialog.alert(MailBody);
            System.exit(0);
            return true;            
    }    
}
Please help me.

Thx a lot.

MfG Martin
P.S.: Sry for the bad english i hope you understand it. If you can answer in German plz do it.

Last edited by GERMartin; 07-13-2007 at 05:10 AM..
Offline  
Old 07-13-2007, 05:15 AM   #2
pa4o85
Thumbs Must Hurt
 
Join Date: May 2007
Location: Bulgaria
Model: none
PIN: N/A
Carrier: Mtel
Posts: 150
Default

That is how you can invoke the sending e-mail application for the blackberry. Your application is running in the background and when you send the e-mail you will get back to your application

Invoke.invokeApplication(Invoke.APP_TYPE_MESSAGES ,
new MessageArguments(MessageArguments.ARG_NEW, "address@address.com", "Email", "Body"));
Offline  
Old 07-13-2007, 05:31 AM   #3
GERMartin
Knows Where the Search Button Is
 
Join Date: Jul 2007
Model: 8800
PIN: N/A
Carrier: Vodafone
Posts: 29
Default

ohh sry i have forgotten to say there is 2 other class to which create a "gui"
I've only said i get it from the Hello world and there ist a little "gui"

Do you mean with Mail the Subject of the mail (at this place "address@address.com", "Email", "Body")


edit:
ahh now its compiling
I import now net.rim.blackberryapi.invoke.*;

Thx a lot for your help. i Hope it will work. I must try it on a very old PC (633MHz , 128MB Ram)

Last edited by GERMartin; 07-13-2007 at 05:56 AM..
Offline  
Old 07-13-2007, 06:26 AM   #4
GERMartin
Knows Where the Search Button Is
 
Join Date: Jul 2007
Model: 8800
PIN: N/A
Carrier: Vodafone
Posts: 29
Default

Great, it works, i hope it is good enough.

is there maybe an easy way to send a Mail without show this menu?
Offline  
Old 07-13-2007, 07:08 AM   #5
pa4o85
Thumbs Must Hurt
 
Join Date: May 2007
Location: Bulgaria
Model: none
PIN: N/A
Carrier: Mtel
Posts: 150
Default

i think it is the easiest way....one line and it is working...maybe there is a way to send an e-mail directly from your application...but i used what i post to you Good Luck
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


USB BIOS EEPROM SPI FLASH Programmer CH341A 24 25 series BIOS Writer Burner Chip picture

USB BIOS EEPROM SPI FLASH Programmer CH341A 24 25 series BIOS Writer Burner Chip

$7.57



CH341A 24 25 Series EEPROM Flash BIOS USB Programmer Module + SOIC8 Test Clip picture

CH341A 24 25 Series EEPROM Flash BIOS USB Programmer Module + SOIC8 Test Clip

$5.88



10PCS DIP-28 Eeproms Programmable Flash Chip For SST27SF512-70-3C-PG SST 27SF512 picture

10PCS DIP-28 Eeproms Programmable Flash Chip For SST27SF512-70-3C-PG SST 27SF512

$27.89



5PCS EEPROM IC ATMEL DIP-28 AT28C256 AT28C256-15PU US picture

5PCS EEPROM IC ATMEL DIP-28 AT28C256 AT28C256-15PU US

$33.99



10PCS For SST27SF512-70-3C-PG SST 27SF512 DIP-28 Eeproms Programmable Flash Chip picture

10PCS For SST27SF512-70-3C-PG SST 27SF512 DIP-28 Eeproms Programmable Flash Chip

$27.69



10PCS W27C512-45Z W27C512 DIP IC EEPROM 512KBIT 45NS Winbond EEPROMs USA picture

10PCS W27C512-45Z W27C512 DIP IC EEPROM 512KBIT 45NS Winbond EEPROMs USA

$17.98







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