Email configured in the product or not...

Hello everyone, I am working on Blackberry 9800 "BOLD", my native language is java. I'm working on a program that will tell me if e-mail address is configured on my device or not. Part of my code is given below, but it is not working properly... Please someone help me for this...:
Full book sb = ServiceBook.getSB ();
SRS [] ServiceRecord is sb.findRecordsByCid("CMIME");.
SRS [] ServiceRecord = sb.getRecords ();

for (cnt int = srs.length - 1; cnt > = 0; cnt-)
{
identify the record of service associated with a service of mail message via a «CMIME» CID
If (srs [cnt] .getCid () .equals ("CMIME'))
{
                           Dialog.Alert ("e-mail address is registered");
}
else {}
                            Dialog.Alert ("email address is not saved");
(UiApplication.getUiApplication).pushScreen(new AgAppdntactUs());
}
}

Java Forum would be the best place to ask questions about Java

http://supportforums.BlackBerry.com/T5/Java-development/BD-p/java_dev

In any case, I will comment on the issue too. Your approach is wrong on a very rudimentary level. Why? Because you are trying to send mail on behalf of the user. As a user, I am very suspicios Apps that do things, that I did not authorize. In addition, you must deal with all kinds of scenarios: corporate firewall, device without network etc etc. Moreover, I like 10 emails saved on my device, that one will choose you? I'd be very angry to see my personal e-mail used in communication support (I guess sending complaints from users, it's what you want to achieve)

Average IMO much simpler and easier to implement this is just to call the application native mail, fill in all fields and allow the user click on the Send button. Example code below:

        String to = "[email protected]";
        String subject = "Complaint";
        String body = "Some text";
        Invoke.invokeApplication( Invoke.APP_TYPE_MESSAGES,
            new MessageArguments(MessageArguments.ARG_NEW, to, subject, body));

Tags: BlackBerry Developers

Similar Questions

Maybe you are looking for