MFMailComposeVIEwController *picker = [[MFMailComposeVIEwController alloc] init];picker.mailComposeDelegate = self;// Set the subject of email[picker setSubject:@"My data file"];// Add email addresses[picker setToRecipIEnts:[NSArray arrayWithObjects:emailID,nil]];// Fill out the email body textNsstring *emailBody = @"Hello,\n Please find the data from the iOS app in the attachments.\n\n Thank you.\nMy Team.";// This is not an HTML formatted email[picker setMessageBody:emailBody isHTML:NO];// Create NSData object from fileNSData *exportfileData = [NSData dataWithContentsOffile:filePath];// Attach image data to the email[picker addAttachmentData:exportfileData mimeType:@"text/csv" filename: [self.CSVnameTextFIEld text]];// Show email vIEwif ([MFMailComposeVIEwController canSendMail]) { [self presentModalVIEwController:picker animated:YES];}解决方法 使用应用程序发送邮件后,转到iPhone上的Mail-Software,您很可能会在发件箱中找到邮件.
因为MFMailComposeVIEwController只会将邮件转发到邮件软件,它不关心邮件旁边会发生什么.因此,您的邮件软件将如何以及何时更新发件箱.
总结以上是内存溢出为你收集整理的MFMailComposeViewController canSendMail返回YES但不在iOS中发送邮件全部内容,希望文章能够帮你解决MFMailComposeViewController canSendMail返回YES但不在iOS中发送邮件所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)