Package net.rim.blackberry.api.mail

Examples of net.rim.blackberry.api.mail.Session


        Address toAdds[] = new Address[1];
        toAdds[0] = toAdd;
        message.addRecipients(Message.RecipientType.TO, toAdds);
        message.setSubject(subject);
        message.setContent(mp);
        Session session = Session.getDefaultInstance();
        Transport trans = session.getTransport();
        //add recipients to the message and send
        boolean sent = false;
        try {
             trans.send(message);
             sent = true;
View Full Code Here


                              {
                                    ServiceConfiguration sc = new ServiceConfiguration(record);
                             
                                    if (sc != null)
                                    {
                                        Session session = Session.getInstance(sc);
                                       
                                        if (session != null)
                                        {
                                          // if the service does not exist in the hashtable,
                                          // create a new vector and put them into the hashtable
                                          if (_listenerHash.get(emailService)==null) {
                                             
                                              _listener = new EmailListener(emailService)
                                              _vec = new Vector();
                                                _vec.addElement(callback);
                                                _listenerHash.put(emailService, _vec );
                                          }else{
                                                _vec = (Vector)_listenerHash.get(emailService);
                                                _vec.addElement(callback);
                                                _listenerHash.put(emailService, _vec);
                                          }// end if (_listenerHash.get(emailService)==null)

                                            Store store = session.getStore();
                                            Folder[] folders = store.list(Folder.INBOX);
                                            Folder inbox = folders[0];
                                            inbox.addFolderListener(_listener);
                                           
                                           // callback.invoke(null, new Object[] { "added listener" });
View Full Code Here

        /*
        listenerSMS = new SMSListener();
        */
       
        //DEBUG INFO
        Session session = Session.getDefaultInstance();
        StaticDataHelper.log("### in SyncClient(): session is " + session +
                             ", mailSyncAllowed is " + mailSyncAllowed +
                             ", showServiceWarning is " + showServiceWarning);

        //Phone.addPhoneListener(listenerCalls);//a listener to the incoming calls
View Full Code Here

   
    /**
        * Adds the folder listener
        */
    public void setMailListener() {
        Session session = Session.getDefaultInstance();//waitForDefaultInstance() used to
                                                        //retrieve this device's default
                                                        //mail service is blocking!
        Store store = session.getStore();
       
        //The listener is invoked when FolderEvents
        //occur on *any* folder in the store
        store.addFolderListener(this);
        //store.addSendListener(this);
View Full Code Here

      ServiceBook sb = ServiceBook.getSB();
      ServiceRecord[] records = sb.findRecordsByCid(CMIME);
      mailStores = new Store[records.length];
      for (int i = 0; i < records.length; i++) {
        ServiceConfiguration sc = new ServiceConfiguration(records[i]);
        Session session = Session.getInstance(sc);
        mailStores[i] = session.getStore();
      }
    } catch (Exception e) {
      // carry on
    }
    setFont(BannerFont.getFont());
View Full Code Here

        Address[] to;

        // Find an outbox folder and use it to construct a new message
        Folder outbox = null;

        final Session session = Session.getDefaultInstance();
        if (session != null) {
            final ServiceConfiguration serviceConfiguration =
                    session.getServiceConfiguration();
            if (serviceConfiguration != null) {
                outbox = session.getStore().findFolder("Outbox")[0];
            } else {
                PIMDemo.errorDialog("Error: Email service not available, could not send notification to invitees");
                return;
            }
        }
View Full Code Here

TOP

Related Classes of net.rim.blackberry.api.mail.Session

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.