1

I'm trying to include an image in an email, which is being sent using a mailto: URL in an iPhone app. The image shows up on the sender's mail app, but after being sent, the tag seems to be stripped out entirely. Here's a snippet, which has been escaped by hand:

[mailUrl appendString:@"&body=%3Cimg%20src%3D%22http%3A//stackoverflow.com/content/img/stackoverflow-logo.png%22%20/%3E"];

Short of using my own SMTP server, or sending them as attachments, is there any way to embed images in an email on the iPhone?

3 Answers 3

3

No there is no way to do it using the iPhone SDK up till version 2.2.1.

There is a way to do it with the 3.0 SDK but it is under NDA so I cannot discuss it here :(

1
  • Arg, that's disappointing. I'll take a look at the 3.0 SDK, though. Thanks! Apr 30, 2009 at 21:43
2

http://webbuilders.wordpress.com/2009/11/16/url-must-be-url-encoded-inside-a-nsstring-in-objective-c/

This new account won't allow me to post my answer. I include info here

1
  • This is very useful information. However, the issue is not the character encoding; it's that the APIs that handle mailto: strip out certain HTML tags, including <img>. I'll be revisiting the issue soon using the 3.x SDK, which supposedly can work around the problem. Nov 16, 2009 at 19:44
1

Luke, probably not useful to you anymore, but in researching this topic someone mentioned that wrapping the image with <b></b> prevents the iphone mail app from stripping the img tag. I tried it and it works for me.

2
  • I'm assuming there's a word left out there. :) Wrapping the image with...? Sep 15, 2009 at 22:26
  • Ah sorry markup trouble, a bold tag will do the trick, let's see if I can fix my comment Sep 29, 2009 at 10:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.