Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

BlackBerry® OS Smartphones

Reply
Highlighted
New Member
Posts: 1
Registered: ‎10-29-2008
My Device: Not Specified

I can't attach a image to mail

Hi, I'm sorry but my english is very bad...

 

I can't attach to image (Gif) to mail in the simulator jde 4.6..

 

this is my source..... I get a problem " Email service does not support these types of

attachments.Change the send using field or remove the attachments" 

 

Multipart mp = new Multipart();

              String fileName = ArchivoPrincipal.FILE_NAME+ArchivoPrincipal.EXTENSION;                       
                        //create the file                                 
                       
                        //FileSupportedAttachmentPart sap = new FileSupportedAttachmentPart(mp ,
                                //"image/Gif",fileName);
                       
                        SupportedAttachmentPart sap = new SupportedAttachmentPart(mp, "image/gif","prueba"+ArchivoPrincipal.EXTENSION,ArchivoPrincipal.imagenActual);
                         
                       
                        String columnas[][][] = _archivoPrincipal._hiloData.getColumnas();
                        int plog = Integer.parseInt(_archivoPrincipal._hiloData.getParametro());
                        String mensaje="";

for(int i=0;i<columnas[plog].length;i++){
                            for(int j=0;j<columnas[plog][i].length;j++){
                                mensaje += columnas[plog][i][j];
                                if(i !=0 ){
                                  for(int k=0;k<(columnas[plog][0][j].length()-columnas[plog][i][j].length())+5;k++)
                                      mensaje+=" ";
                                    }
                                 else
                                    mensaje+=" ";
                            }
                            mensaje += ((char)10);
                        }
                        TextBodyPart tbp = new TextBodyPart(mp,mensaje);

               //add the file to the multipart                       
                        mp.addBodyPart(tbp);
                        mp.addBodyPart(sap);

                  //create a message in the sent items folder6
                        //Folder folders[] = Session.getDefaultInstance().getStore().list(Folder.SENT);

                  //Message message = new Message(folders[0]);
                        Message message = new Message();

//add recipients to the message and send
                        try {
                            Address toAdds[] = new Address[1];
                            Address toAdd = new Address("felix.alvarado@giga.ec","Felix Alvarado");
                            toAdds[0] = toAdd;
                            message.addRecipients(Message.RecipientType.TO,toAdds);
                            message.setContent(mp);
                            message.setSubject("Report K360");
                            MessageArguments marg =  new MessageArguments(message);
                            Invoke.invokeApplication(Invoke.APP_TYPE_MESSAGES, marg);
                           
                        } catch (Exception e) {
                            Dialog.inform(e.toString());
                        }

 

 

I thanks by the help....

Forums Veteran III
Posts: 4,526
Registered: ‎10-16-2008
My Device: Bold - T-mobile

Re: I can't attach a image to mail

Sorry for all the community, but i need to reply in spanish.

Felix, el problema que estas teniendo al intentar insertar la foto, en donde es?, en un mail?

Estas usando un exchange o solo la internet del blackberry?

--------------------------------------------------------------------------------
If I help you with any inquire, thank you for click kudos in my post.
If your issue has been solved, please mark the post was solved.