HTML5   发布时间:2022-04-27  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了MFMailComposeViewController canSendMail返回YES但不在iOS中发送邮件大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
以下是我在邮件中发送附件的代码.这很好用.我能够发送邮件,但我并不总是收到邮件.

@H_810_7@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 text NSString *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 file NSData *exportFileData = [NSData dataWithContentsOfFile:filePath]; // Attach image data to the email [picker addAttachmentData:exportFileData mimeType:@"text/csv" filename: [self.CSVNameTextField text]]; // Show email view if ([MFMailComposeViewController canSendMail]) { [self presentModalViewController:picker animated:YES]; }

解决方法

使用应用程序发送邮件后,转到iPhone上的Mail-Software,您很可能会在发件箱中找到邮件.

因为MFMailComposeViewController只会将邮件转发到邮件软件,它不关心邮件旁边会发生什么.因此,您的邮件软件将如何以及何时更新发件箱.

大佬总结

以上是大佬教程为你收集整理的MFMailComposeViewController canSendMail返回YES但不在iOS中发送邮件全部内容,希望文章能够帮你解决MFMailComposeViewController canSendMail返回YES但不在iOS中发送邮件所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。