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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:02:22+00:00 2026-06-13T08:02:22+00:00

I have got a strange issue , the below code works fine in IOS5

  • 0

I have got a strange issue , the below code works fine in IOS5 device , all simulators , but fails in IOS6 Device.I am getting a blank view in place of image.

Requirement : Need to add the image in mail.

NSString *imageName = @"classroom_tile.png"; 
imagePath = [[NSBundle mainBundle]bundlePath];
imagePath = [imagePath stringByAppendingPathComponent:[NSString   stringWithFormat:@"%@",imageName]];
imagePath = [@"file:///" stringByAppendingString:imagePath];

NSString *formatedUrl = [NSString stringWithFormat:@"</br><table border =\"0\"><tr><td></td><th>%@</th></tr><tr><td><img src= \'%@\' width=200 height=150></td></tr></table>",sometext,imagePath];
[mailComposer setMessageBody:formatedUrl isHTML:YES];

Please do suggest.

Thanks and Regards,
Anil

  • 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-06-13T08:02:23+00:00Added an answer on June 13, 2026 at 8:02 am

    What you are trying to do has never been supported. The only valid way to get an image into an email is to add the image as an attachment. But even then you can’t reference the image attachment in the mail message body.

    What works in the simulator is irrelevant for something like this since you can’t actually send the email in the simulator. Let me ask this – when running this on an iOS 5 device, does the received email sent from the app actually show the image or does it only appear correctly in the mail composer in the app? I’d be quite surprised if such an email sent from the app and opened in some email client on a user’s computer showed the image.

    Edit: It turns out this really did work under iOS 5 but doesn’t under iOS 6. I’m quite surprised. I did my own quick test. Under iOS 5.1 sending an email with such an image reference to a local file on the iOS device actually does get sent along with the email and does appear in the client email program on their computer. When the app is run under iOS 6, the image does not appear in the mail composer in the app nor in the received email. So at least that is consistent.

    One other little side note. This line:

    imagePath = [imagePath stringByAppendingPathComponent:[NSString stringWithFormat:@"%@",imageName]];
    

    should be:

    imagePath = [imagePath stringByAppendingPathComponent:imageName];
    

    Don’t use stringWithFormat: unless you are actually using a string format. Also, there is no need to create the extra NSString object.

    Also, here’s a better way to get the path to a file in your resource bundle:

    NSString *imagePath = [[NSBundle mainBundle] pathForResource:@"classroom_tile" ofType:@"png"];
    

    That one line would replace the first three lines you posted.

    One last note. When using an HTML email message, include the <html> and <body> tags.

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

Sidebar

Related Questions

Ok so this is kind of a strange issue, but I have got two
I have a very strange issue. My appplicaiton works fine on my PC (as
I have got a very strange input issue in which it seems that my
I have strange issue with nested left-joins in postgresql... It's hard to explain, but
I've got a strange issue. This is suddenly started happening in the code that
I've got a strange issue. I have a class that inherits from RelativeLayout .
I have got a strange problem about in_array recently which I cannot understand. e.g.
I got a strange problem. I have a tabcontrol and 3 tabs. On every
I have probem / strange question, i got algorithm with few for loops and
I have got this code: function init(){ if (typeof window.jQuery !== 'function') { var

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.