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


4.5 CFM Single-Stage Rotary Vacuum Pump HVAC/Auto AC 4.5CFM 1/3HP 1/4

4.5 CFM Single-Stage Rotary Vacuum Pump HVAC/Auto AC 4.5CFM 1/3HP 1/4"ACME inlet

$29.37



Shop Vacuum upholstery extractor conversion kit auto vac detail carpet or home.  picture

Shop Vacuum upholstery extractor conversion kit auto vac detail carpet or home.

$220.00



BISSELL PowerForce Helix Turbo Pet Upright Vacuum 3332 picture

BISSELL PowerForce Helix Turbo Pet Upright Vacuum 3332

$54.00



VEVOR 9

VEVOR 9" Drywall Sander 850W Vacuum System Folding 6 Speed LED Strip Light

$87.99



NEW Portable Heavy-Duty Suction Machine HIGH SUCTION VACUUM UNIT PUMP picture

NEW Portable Heavy-Duty Suction Machine HIGH SUCTION VACUUM UNIT PUMP

$139.99



Cordless Vacuum Cleaner Stick Handheld for Carpet Pet Hair & Wood Floor Bagless picture

Cordless Vacuum Cleaner Stick Handheld for Carpet Pet Hair & Wood Floor Bagless

$96.90







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