MFMailComposeViewController canSendMail返回YES但不在iOS中发送邮件

MFMailComposeViewController canSendMail返回YES但不在iOS中发送邮件,第1张

概述以下是我在邮件中发送附件的代码.这很好用.我能够发送邮件,但我并不总是收到邮件. MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];picker.mailComposeDelegate = self;// Set the subject of email[picker setSu 以下是我在邮件中发送附件的代码.这很好用.我能够发送邮件,但我并不总是收到邮件.

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中发送邮件所遇到的程序开发问题。

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

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1078533.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-27
下一篇 2022-05-27

发表评论

登录后才能评论

评论列表(0条)

保存