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

  • Home
  • SEARCH
  • 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 7447115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:30:49+00:00 2026-05-29T12:30:49+00:00

I am using the MessageUI framework to send and image via e-mail after taking

  • 0

I am using the MessageUI framework to send and image via e-mail after taking the photo using UIImagePickerController. When I take the photo and then invoke the mail mail message interface I get the compose window. When testing on an iPod touch (iOS 4.3.5) and iPad (iOS 5.0.1) I see the image attachment in the body of the compose window. When testing on an iPhone (4S iOS 5.0.1) the image does not appear in the compose window, but rather I see a box the size of the image attachment with an embedded small blue box with a “?” in it.

In both cases when the mail message is sent the image appears in the message received in the Mail app – iOS devices and Mac.

What can I do to fix this?

UPDATE: I’ve worked around this by changing:

NSData *imageData = [NSData dataWithData:UIImagePNGRepresentation(imageToSend)]

to:

NSData *imageDataJPG = [NSData dataWithData:UIImageJPEGRepresentation(imageToSend, 1.0)];

I can’t see in the UIKit docs that there is anything in UIImagePNGRepresentation that would not work on an iPhone …

(Xcode 4.2.1, ARC, 5.0 SDK, Deploy target 4.3)

Here is the code for composing the message:

-(void)displayComposerSheet
{
MFMailComposeViewController *mailPicker = [[MFMailComposeViewController alloc] init];
mailPicker.mailComposeDelegate = self;

[mailPicker setSubject:@"Photo"];

NSData *imageData = [NSData dataWithData:UIImagePNGRepresentation(imageToSend)];
[mailPicker addAttachmentData:imageData mimeType:@"image/png" fileName:@"Photo"];


// Fill out the email body text.

NSString *line1 = [NSString stringWithFormat: @"I took this photo on my %@.\n", [[UIDevice currentDevice] model]];


NSString *body = [NSString stringWithFormat:@"%@", line1];
[mailPicker setMessageBody:body isHTML:NO];

// Present the mail composition interface.
[self presentModalViewController:mailPicker animated:YES];

}

  • 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-29T12:30:50+00:00Added an answer on May 29, 2026 at 12:30 pm

    The image size is restricted so if the image you are sending through is greater than a certain dimension you’ll get the effect you describe above.

    I had a look at my own code and saw I had

    #define MAX_MAIL_DIM 1536

    Which seems to be 1024 * 1.5. Sorry I can’t remember how I arrived at that number but I suspect it was trial and error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When creating a new message using Mail on the iPhone, and after typing the
I'm using Zend_Mail in a Zend Framework application to send an e-mail with the
I am using the MessageUI framework to send an email but I never receive
I'm trying to send an email message using the .NET MailMessage class which can
I'm using JSON-Framework in my project successfully to decode JSON send from a server.
I'm using the Django Message Framework to show messages to users as well as
I have a function that sends email using asp.net built in mail framework. I've
Is it possible to send messages from inside an app, using MessageUI framwork on
I'm using Zend_Queue to queue and send out emails (http://framework.zend.com/manual/en/zend.queue.adapters.html) Is there a way
I created a new email-message using Redemption-Data-Objects in C#. After calling Display(), the window

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.