我正在使用MFMailcomposer从我的iPhone应用程序发送邮件.它工作正常,但是当我将它移植到iPhone 5和ios6时
_serviceViewControllerReady:error: Error Domain=_UIViewServiceInterfaceErrorDomain Code=1 "The operation couldn’t be completed. (_UIViewServiceInterfaceErrorDomain error 1. 但如果我再次运行没有问题,它工作正常.
我正在呈现像这样的邮件作曲家
action
{
Class mailClass = (NSClassFromString(@"MFMailComposeViewController"));
if (mailClass != nil)
{
// We must always check whether the current device is configured for sending emails
if ([mailClass canSendMail])
{
[self displayComposerSheet];
}
else
{
[self launchMailAppOnDevice];
}
}
else
{
[self launchMailAppOnDevice];
}
}
void)displayComposerSheet
{
AppDelegate *appdelegate=[[UIApplication sharedApplication] delegate];
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
[picker setSubject:@"report"];
// Set up …Run Code Online (Sandbox Code Playgroud) 我正在创建一个带有密码重置功能的iOS应用程序,该功能可以向用户发送电子邮件.发送电子邮件后,我想向UIAlertController用户询问是否要打开邮件应用程序.
我在这里看到了各种各样的帖子:
let url = NSURL(string: "mailto:")
UIApplication.sharedApplication().openURL(url!)
Run Code Online (Sandbox Code Playgroud)
这可行,但不幸的是它启动了一条不是我想要的新消息.我只想启动应用程序,以便用户可以看到他们的收件箱.
我正在编写一个iPhone应用程序,要求我以编程方式发送电子邮件附件.附件是一个csv文件,我通过代码创建.然后我将文件附加到电子邮件中,附件显示在手机上.但是,当我向自己发送电子邮件时,附件不会出现在电子邮件中.这是我正在使用的代码.
[self exportData];
if ([MFMailComposeViewController canSendMail])
{
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"expenses" ofType:@"csv"];
NSData *myData = [NSData dataWithContentsOfFile:filePath];
MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc] init];
mailer.mailComposeDelegate = self;
[mailer setSubject:@"Vehicle Expenses from myConsultant"];
NSString *emailBody = @"";
[mailer setMessageBody:emailBody isHTML:NO];
[mailer addAttachmentData:myData mimeType:@"text/plain" fileName:@"expenses"];
[self presentModalViewController:mailer animated:YES];
[mailer release];
}
else
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Failure"
message:@"Your device doesn't support the composer sheet"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
[alert release];
}
}
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error
{
switch …Run Code Online (Sandbox Code Playgroud) 晚上,我正试图通过按钮操作打开Mail应用程序的收件箱邮件...
在网络上,我看到有可能打开EmailComposer对象的电子邮件应用程序..但我不是要发新电子邮件,我只是想让用户检查电子邮件.
有小费吗?
关于这个主题有很多问题,但没有更新的答案.我想在没有撰写视图的情况下打开本机iOS邮件应用程序(在我自己的应用程序中).所有答案都是如此,说这是不可能的,但应用程序Slack设法做到这一点.任何人都有任何想法?
我正在开发iPhone电子书应用程序.
在我的应用中,书籍是使用HTML创建的.在Index.html页面中,我必须发送电子邮件(发送)特定章节内容的电子邮件功能.
现在通过使用webview我显示index.html,并且我创建了UIActionSheet,它将显示Email按钮.
请建议我如何识别不同链接的索引以发送特定章节的电子邮件.