Note that there are some explanatory texts on larger screens.

plurals
  1. POProblem attaching file programmatically to blackberry Email Client
    text
    copied!<p>I am attempting to attach an excel spreadsheet to an email programmatically, and then launch the default blackberry email client with the message as an argument. Unfortunately, I receive the error: "Email service does not support these types of attachments. Change the Send Using field or remove the attachments." The send button is not present, and there is no "Send" option in the menu; this is blocking the ability to send the email.</p> <p>This error occurs when I load the package onto my physical blackberry phone, as well as in the simulator. </p> <p>I am able to send the email without a hitch if I use the API instead (the commented transport.send line). </p> <p>Any and all input would be greatly appreciated, and if I've overlooked some details please let me know.</p> <pre><code>public Email() { try{ message = new Message(); multipart = new Multipart(); //Multi part can hold attachment AND body (and more) subject = "Service Change Request"; multipart.addBodyPart( new TextBodyPart( multipart, "Hi XXXXXX, \n Here are the details for CLIENT" ) ); byte[] data = null; InputStream stream = MyAPP.getUiApplication().getClass().getResourceAsStream("/blank_form.xls"); data = IOUtilities.streamToBytes(stream); stream.close(); multipart.addBodyPart( new SupportedAttachmentPart( multipart, "application/octet-stream", "ServiceUpdate.xls", data ) ); Address recipients[] = new Address[1]; recipients[0]= new Address("*******@gmail.com", "user"); message.setSubject(subject); message.setContent( multipart ); message.addRecipients(Message.RecipientType.TO, recipients); //Transport.send(message); }catch(Exception e){ } } public void send(){ Invoke.invokeApplication( Invoke.APP_TYPE_MESSAGES, new MessageArguments( message ) ); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload