Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7014073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:28:24+00:00 2026-05-27T22:28:24+00:00

I am developing a BlackBerry application that uses the Mail functionality. My problem is

  • 0

I am developing a BlackBerry application that uses the Mail functionality. My problem is
I want to send mail with an image attachment. How can I do that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T22:28:24+00:00Added an answer on May 27, 2026 at 10:28 pm

    You can convert the image to byte array and then use the following method to send the file as attachment.

    public synchronized boolean sendMail(final byte []data) 
            {    
            Folder[] folders = store.list(4);
            Folder sentfolder = folders[0];
            // create a new message and store it in the sent folder
            msg = new Message(sentfolder);
            multipart = new Multipart();
            textPart = new TextBodyPart(multipart,"Image");
            Address recipients[] = new Address[1];
            try {
    
                    recipients[0] = new Address(address, "XYZ");
                    msg.addRecipients(Message.RecipientType.TO, recipients);
                    msg.setSubject("Image"); 
                    try {
                            Thread thread = new Thread("Send mail") {
                                    public void run() { 
                                            try {
    
    
                                                        attach = new SupportedAttachmentPart(
                                                                    multipart, "application/octet-stream",
                                                                    "title",data);                                                      
    
    
                                                    multipart.addBodyPart(textPart);
                                                    multipart.addBodyPart(attach);
                                                    msg.setContent(multipart);
                                                    Transport.send(msg); 
                                            }
                                            catch(SendFailedException e)
                                            {
    
                                            } 
                                            catch (final MessagingException e) { 
    
    
                                            } 
                                            catch (final Exception e) { 
    
                                            }
    
                                    }           
                            };
                            thread.start(); 
                            return true;
                    } 
                    catch (final Exception e) 
                    { 
    
                    }
            }catch (final Exception e) {
    
            }
    
            return false;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing an application for Blackberry wich uses networking capabilities. The request is executed
I am developing BlackBerry application that connects to the web service. When I developed
When developing on BlackBerry or iOS, you can deploy your application just by dropping
I am developing Blackberry application. Every time when i want to test my app
I am developing a BlackBerry application that should work on OS 4.5+. I have
I am developing an Blackberry application. I want to show a hint text in
I am developing a web application that uses JSF 1.2 for the view layer.
I am developing a BlackBerry application. I want to store the details of multiple
i have been working on developing an blackberry application. as per now i want
I am developing blackberry application using BlackBerry JDE 5.0.X , in which i am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.