tags:

views:

1006

answers:

4

I would like to provide my users the ability to send an image/picture (displayed through a UIImageView in the app) to their friends via email using the built-in Mail app.

In a way, I want a very similar user experience to the way the Photos app does this. User clicks on a button, the image/picture is copied onto a new "compose" mail window on Mail app, and then they can finish sending the message over to whoever they want.

I searched quite a bit for tips on how to do this, and found nothing. A few people actually posted before on different message boards that this is not possible at all in SDK-land.

Anyone with more information on this?

+3  A: 

If you plan on putting the app in the App Store, you're limited to the standard mailto links as specified in the iPhone URL Scheme Reference:

http://developer.apple.com/iphone/library/featuredarticles/iPhoneURLScheme_Reference/Articles/MailLinks.html#//apple_ref/doc/uid/TP40007892

The options you have within the mailto link are spelled out in RFC 2368:

http://www.ietf.org/rfc/rfc2368.txt

The only thing that seemed remotely possible was using the mailto link to set the headers to describe the message as having an attachment and then adding in the MIME/base64 encoded data within the body of the message. I highly doubt that such an approach would work since the mailto link was not intended to be used this way - the RFC states:

"The mailto URL is primarily intended for generation of short text messages that are actually the content of automatic processing (such as "subscribe" messages for mailing lists), not general MIME bodies."

However, even if the above method did work, the RFC still leaves it open to the email client to choose to ignore or otherwise modify "dangerous" headers within the link - so even if you were able to construct a valid mailto URL with a MIME body and the proper headers, Mail.app may still choose to ignore the attachment related parts of your message.

If you try to communicate with Mail.app in any other way, you have a very high likelihood of being rejected by Apple.

Adam Byram
A: 

send the image to a web application that will inturn do the sending. using the mailto scheme will launch iphone's email application but your application will quit meaning the user will have to relaunch it later..

A: 

Now you can send MFMailComposeViewController. Look this sample of attaching an image to email.

slatvick
A: 

thanks for suggestion.....

Techs24x7.com