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 315791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:19:27+00:00 2026-05-12T08:19:27+00:00

I am using inbuilt composer of iPhone to send an email in my application.

  • 0

I am using inbuilt composer of iPhone to send an email in my application. I want to add images to body of my email. Please remember I want to place images in the body and not want to attach the images to the email. I know how to attach them.

Its like I want to place multiple images in the body with some details for them in front of the respective image.

Is there any way to do that.

Like using html, the following code show me a question mark instead of an image.

NSData *imageData = [dbPersistenceObj getImageForEmail:[[imageIdArray objectAtIndex:i] intValue]]; 
NSString *encodedImage = [imageData description]; 
emailBody = [emailBody stringByAppendingFormat:@"<img src=\"cid:Img-1\"/>", imageData]; 
[picker addAttachmentData:imageData mimeType:@"image/png" fileName:@"Img-1"];
  • 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-12T08:19:27+00:00Added an answer on May 12, 2026 at 8:19 am

    Edited after some experimentation

    My original answer is not in fact a solution to the question. It appears that with MFMailComposeViewController you cannot reference attached images in an HTML email body using the cid: syntax.

    If you attach the image after setting an HTML body the iPhone will internally use cid: to display the image, but only in the fashion in which it is normally represented in the composer view – so it’s not that flexible.

    Finally, it is possible to use the data:image/png;base64, embedded image source URL scheme but this does not seem to be widely supported by email clients – notably it does not fail gracefully in GMail.

    Original answer:

    Note: I haven’t tried this.

    Assuming that you are using MFMailComposeViewController in iPhone SDK 3.0+: You could try creating an HTML format email body and reference the attached image from within that HTML document.

    HTML

    ...
    <img src="cid:content-id"/> <!-- 'cid:' is important -->
    ...
    

    Objective-C

    ...
    [mailController addAttachmentData:pngData
                             mimeType:@"image/png"
                             fileName:@"content-id"];
    [mailController setMessageBody:html isHTML:YES];
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using inbuilt framework of iPhone sdk to send an email. So is
I've got a project where by I send email using PHP's inbuilt mail() function,
I m going to develope an application in which i m not using inbuilt
using this http://bl.ocks.org/950642 we can see how to add images to nodes, the question
I am developing an asp.net web site and I am not using inbuilt authentication
I'm doing a simple UDP send using Node's inbuilt datagram UDP socket : http://nodejs.org/docs/v0.3.1/api/dgram.html
I want to make a stop-watch in C (live Stop-watch) without using inbuilt function
I'm using a Silverlight 4 dataform and attempting to use the inbuilt add button
I want to add basic exif info to images like author,camera model,date etc.Is there
I'm using CKEditor and it's inbuilt filemanager to allow people to change content/upload images

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.