直接在黑莓中打开撰写电子邮件窗口

时间:2012-05-29 07:12:31

标签: blackberry

  

可能重复:
  How to open the Blackberry email app, ready to compose an email to a given address?

我点击一个按钮。在按钮单击时,用户应移至“撰写电子邮件”屏幕。

2 个答案:

答案 0 :(得分:2)

    MessageArguments ma = new MessageArguments(MessageArguments.ARG_NEW, <recipients>, <subject>, <body>);
    //Alternatively, if you don't want to provide default values: ma = new MessageArguments(MessageArguments.ARG_NEW);

    Invoke.invokeApplication(Invoke.APP_TYPE_MESSAGES, ma);

答案 1 :(得分:1)

这工作正常,试试这个,

public void SendMail() 
        {


            String htmlContent =  "Body part";

            Message msg = new Message(); 
            try 
            { 
                final Address address = new Address("",""); 
                Address[] addresses = {address}; 
                msg.addRecipients(net.rim.blackberry.api.mail.Message.RecipientType.TO, addresses); 
                msg.setContent(htmlContent); 
                msg.setSubject("Subject"); 

                Invoke.invokeApplication(Invoke.APP_TYPE_MESSAGES, new MessageArguments(msg));

            } 
            catch (AddressException e) 
            { 
                e.printStackTrace(); 
                System.out.println("AddressException -->"+e.getMessage()); 
            } 
            catch (MessagingException e) 
            { 
                e.printStackTrace(); 
                System.out.println("MessagingException -->"+e.getMessage()); 
            }
        }