无法在邮件中找到 vcard 附件
我正在尝试从我的 iPhone 发送一封电子邮件,并附上电子名片作为附件。当我发送邮件时,vcard 会附在邮件中。但邮件的收件人找不到 vcard 附件。需要帮助。 这是我用过的代码
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
NSString *path = [[NSBundle mainBundle] pathForResource:@"Vcard" ofType:@"vcf"];
NSData *myData = [NSData dataWithContentsOfFile:path];
[picker addAttachmentData:myData mimeType:@"text/x-vcard" fileName:@"Vcard.vcf"];
[picker setMessageBody:emailBody isHTML:NO];
[self presentModalViewController:picker animated:YES];
[picker release];
谢谢
I am trying to send an email from my iphone, with a vcard as attachment. When I am sending the mail, the vcard is being attached with the mail. But the receiver of the mail can't find the vcard attachment. Help needed.
This is the code I have used
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
NSString *path = [[NSBundle mainBundle] pathForResource:@"Vcard" ofType:@"vcf"];
NSData *myData = [NSData dataWithContentsOfFile:path];
[picker addAttachmentData:myData mimeType:@"text/x-vcard" fileName:@"Vcard.vcf"];
[picker setMessageBody:emailBody isHTML:NO];
[self presentModalViewController:picker animated:YES];
[picker release];
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了解决方案...我在苹果雷达上提交了一个关于它的错误。 MFMailcomposer 有一个错误,您必须发送图像以及额外的附件才能使 pdf 之类的奇怪项目正常工作...尝试此操作并将 pdf 替换为您的卡片:
I found the solution... Isubmitted a bug on Apple radar about it. MFMailcomposer has a bug in which you have to send an image along with your extra attachments in order to get the weird items like a pdf to work... try this and replace the pdf with your card: