How to take a picture and send it as an email attachment in iOS

你离开我真会死。 提交于 2019-12-08 15:53:34

问题


Currently, I can set a button to take a picture, but I'm unsure how to pass this as an attachment for an email in the same view.
The view is for a quote and allows the user to enter data into a few fields then has a button to email said data.


回答1:


Maybe this link would satisfy your requirement for the second half of the question...

http://www.ericd.net/2009/04/sending-email-from-iphone-application.html

    UIImage *myImage = [UIImage imageNamed:@"mobiletuts-logo.png"];
    NSData *imageData = UIImagePNGRepresentation(myImage);
    [mailer addAttachmentData:imageData mimeType:@"image/png"   fileName:@"mobiletutsImage"];

Courtesy:

http://mobile.tutsplus.com/tutorials/iphone/mfmailcomposeviewcontroller/




回答2:


Check out Apple's MailComposer example http://developer.apple.com/library/ios/#samplecode/MailComposer/Introduction/Intro.html#//apple_ref/doc/uid/DTS40008865



来源:https://stackoverflow.com/questions/8203894/how-to-take-a-picture-and-send-it-as-an-email-attachment-in-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!