对不起,如果我错过了我昨天才开始这个 iOS 开发的东西。我有一个基本应用程序,用户最多可以拍摄 3 张图片,这些图片保存在 3 个不同的 UIImageViews 中,该应用程序还检索 gps 坐标并将它们更改为地址。
我想要做的是能够将这些图像和信息发送到电子邮件地址。
目前我有一个链接到一个动作的发送按钮。
谢谢
- (IBAction)sendFinalItem:(UIButton *)sender {
NSLog(@"send button pressed");
MFMailComposeViewController *mailcontroller = [[MFMailComposeViewController alloc] init];
[mailcontroller setMailComposeDelegate:self];
NSString *email =@"MYEMAIL@MYEMAIL.CO.UK";
NSArray *emailArray = [[NSArray alloc] initWithObjects:email, nil];
[mailcontroller setToRecipients:emailArray];
[mailcontroller setSubject:@"[Urgent]Potential Job, iPhone snapped"];
[self presentViewController:mailcontroller animated:YES completion:nil];
}
- (void) mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult: (MFMailComposeResult)result error:(NSError *)error
{
switch (result)
{
case MFMailComposeResultCancelled:
NSLog(@"Mail cancelled");
break;
case MFMailComposeResultSaved:
NSLog(@"Mail saved");
break;
case MFMailComposeResultSent:
NSLog(@"Mail sent");
break;
case MFMailComposeResultFailed:
NSLog(@"Mail sent failure: %@", [error localizedDescription]);
break;
default:
break;
}
// Close the Mail Interface
[self dismissViewControllerAnimated:YES completion:NULL];
}