简体   繁体   中英

Not able to view the data in a attachment in mail when sending the attachments from mfmailcomposer

In MFMailComposer I'm attaching an attachment. I send that attachment to another mail address.

In the destination mail that attachment are displayed with a download option and not with a view option.Actually that attachment is coming from a link. I don't know that attachment is pdf or word documents or any other. I need help, what to do?

I'm using this code:

NSURL *url = [[NSURL alloc] initWithString:self.fileString];
NSData *attachments = [NSData dataWithContentsOfURL:url];
[mailView addAttachmentData:attachments mimeType:@"application/pdf" fileName:self.useridString];

模仿模仿可能会帮助您。

[mailView addAttachmentData:attachments mimeType:@"text/pdf" fileName:self.useridString];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM