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.