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


1Pcs USED A500 7.5KW 380V FR-A540-7.5K-CH frequency converter picture

1Pcs USED A500 7.5KW 380V FR-A540-7.5K-CH frequency converter

$401.02



1PC USED A54MA30B Mitsubishi F500/A500/A540 Series 30-37KW Mainboard #CZ picture

1PC USED A54MA30B Mitsubishi F500/A500/A540 Series 30-37KW Mainboard #CZ

$228.00



1PC USED A54MA55B BC186A413G52 Mitsubishi A500/F540 Series 55KW Drive Board #CZ picture

1PC USED A54MA55B BC186A413G52 Mitsubishi A500/F540 Series 55KW Drive Board #CZ

$317.00



MITSUBISHI FR-A820 1.5K TFA INVERTER A500 240 V #L-220 picture

MITSUBISHI FR-A820 1.5K TFA INVERTER A500 240 V #L-220

$684.00



Mitsubishi FR-A540-0.75K-NA AC DRIVE INVERTER 1 HP 380-480 VAC 50/60 HZ 4.1 AMP  picture

Mitsubishi FR-A540-0.75K-NA AC DRIVE INVERTER 1 HP 380-480 VAC 50/60 HZ 4.1 AMP

$649.99



1PC USED A54MA30B Mitsubishi F500/A500/A540 Series 30-37KW Drive Main Board #CZ picture

1PC USED A54MA30B Mitsubishi F500/A500/A540 Series 30-37KW Drive Main Board #CZ

$255.00







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