如何在 iPhone 应用程序的 Composer 表中添加 vcardfile
在邮件表中,我可以添加图像,但我无法附加 vcard 文件
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
[picker addAttachmentData:ExportVCF mimeType:@"text/x-vcard"
fileName:@ "JOHNSMITH.vcf"];
,但当我发送邮件时,我没有收到附件
in the mail sheet im able to add images but where as im not able to attach vcard file
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
[picker addAttachmentData:ExportVCF mimeType:@"text/x-vcard"
fileName:@ "JOHNSMITH.vcf"];
but when i send a mail im not getting the attachment
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
来自 MFMailCompserViewController 的文档:
如果您查看该链接,您可以看到所有有效的 MIME 类型,并且
text/x-vcard
未列出。我认为这意味着邮件编辑器视图控制器不会允许您附加具有无效(在它看来)MIME 类型的文件。From the documentation for MFMailCompserViewController:
If you look at the link, you can see all the valid MIME types, and
text/x-vcard
is not listed. I think this means that the Mail composer view controller isn't going to allow you attach a a file with an invalid (in it's opinion) MIME type.根据 2014 年 8 月 4 日 MIME 类型的更新
vcard
text/vcard
格式将允许您附加 vcf-vcard 文件。As per the updates in MIME Types on 2014-08-04
vcard
text/vcard
format will allow you to attach vcf-vcard file.基于Wikipedia vCard 页面进行更新:
vCard 的标准互联网媒体类型(通常称为其mime 类型)是:
从版本 4.0 规范开始,以前已知使用的其他媒体类型现已弃用,包括:
Update based on Wikipedia vCard page:
The standard Internet media type for a vCard (often referred to as its mime type) is:
As of version 4.0 specification, other media types known to have been used previously are now deprecated, including: