0
我试图将图像附加到从应用程序发送的邮件图像 我不知道该怎么做,请在这里告知我的代码:从应用程序附加图像到电子邮件
NSString * subject = @"Hello";
NSString * address = @"[email protected]";
NSMutableString *strBody=[[NSMutableString alloc]init];
[strBody setString:_txtName.text];
[strBody appendString:_txtIngredients.text];
[strBody appendString:_txtPreper.text];
[strBody appendString:_txtServe.text];
[strBody appendString:_txtAboutdrink.text];
[strBody appendString:_txtSource.text];
//NSData *data = UIImagePNGRepresentation(_imgDrink);---- here is my problem
NSURL *url;
NSString * path = [NSString stringWithFormat:@"mailto:%@?subject=%@&body=%@", address, subject,strBody];
url = [NSURL URLWithString:[path stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
[[UIApplication sharedApplication] openURL:url];
查看此答案。应该帮助你 http://stackoverflow.com/questions/4302403/how-can-send-a-file-as-attachment-in-objective-c –