views:

1378

answers:

4

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  A: 

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 :(

Panagiotis Korros
Arg, that's disappointing. I'll take a look at the 3.0 SDK, though. Thanks!
Luke Dennis
+1  A: 

Have a look at this SO question

http://stackoverflow.com/questions/531623

epatel
+1  A: 

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.

duncanwilcox
I'm assuming there's a word left out there. :) Wrapping the image with...?
Luke Dennis
Ah sorry markup trouble, a bold tag will do the trick, let's see if I can fix my comment
duncanwilcox
Nifty trick, I'll give that a try, thanks.
Luke Dennis
+1  A: 

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

Bess
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.
Luke Dennis