I'm trying to make a program that can send email from mobile phone, and i'm using Mail4ME API and NetBeans to develop it. Here's the error message :
java.lang.SecurityException: Application not authorized to access the restricted API
at com.sun.midp.security.SecurityToken.checkIfPermissionAllowed(SecurityToken.java:170)
at com.sun.midp.security.SecurityToken.checkIfPermissionAllowed(SecurityToken.java:145)
at com.sun.midp.midletsuite.MIDletSuiteImpl.checkIfPermissionAllowed(+8)
at com.sun.midp.midlet.MIDletState.<init>(+83)
at javax.microedition.midlet.MIDletProxy.<init>(MIDletProxy.java:33)
at javax.microedition.midlet.MIDlet.<init>(MIDlet.java:70)
at SendMailForMe.<init>(SendMailForMe.java:46)
at SendMailForMe.commandAction(SendMailForMe.java:236)
at javax.microedition.lcdui.Display$DisplayAccessor.commandAction(+282)
at javax.microedition.lcdui.Display$DisplayManagerImpl.commandAction(+10)
at com.sun.midp.lcdui.DefaultEventHandler.commandEvent(+68)
at com.sun.midp.lcdui.AutomatedEventHandler.commandEvent(AutomatedEventHandler.java:670)
at com.sun.midp.lcdui.DefaultEventHandler$QueuedEventHandler.handleVmEvent(+186)
at com.sun.midp.lcdui.DefaultEventHandler$QueuedEventHandler.run(+57)
This is the code that i guess has something to do with the error :
public SendMailForMe(String from, String to, String subject) {
this.from = from;
this.to = to;
this.subject = subject;
msg = new Message(from, to, subject);
msg.addBodyLine(message);
}
and this :
SendMailForMe send = new SendMailForMe(from, to, subject);
send.start();
Really confused about it :(