.doc 파일을 내 앱에서 프로그래밍 방식으로 이메일 첨부 파일로 보내려고합니다.iPad에서 첨부 파일로 doc 파일 보내기
1
A
답변
6
mimeType이 "application/msword"인 - [MFMailComposeViewController addAttachmentData :]을 사용하십시오. 예 :
- (void)displayComposerSheet {
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
[picker setSubject:@"I'm attaching a word document!"];
// Set up recipients
NSArray *toRecipients = [NSArray arrayWithObject:@"[email protected]"];
NSArray *ccRecipients = [NSArray arrayWithObjects:@"[email protected]", @"[email protected]", nil];
NSArray *bccRecipients = [NSArray arrayWithObject:@"[email protected]"];
[picker setToRecipients:toRecipients];
[picker setCcRecipients:ccRecipients];
[picker setBccRecipients:bccRecipients];
// Attach a doc to the email
NSString *path = [[NSBundle mainBundle] pathForResource:@"MyDocument" ofType:@"doc"];
NSData *myData = [NSData dataWithContentsOfFile:path];
[picker addAttachmentData:myData mimeType:@"application/msword" fileName:@"MyDocument"];
// Fill out the email body text
NSString *emailBody = @"Please see the attached document.";
[picker setMessageBody:emailBody isHTML:NO];
[self presentModalViewController:picker animated:YES];
[picker release];
}
+0
나는이 코드를 사용하고 있습니다. 유일한 차이점은 .doc 파일을 문서 디렉토리에 저장하는 것입니다.이 메일 첨부 파일은 Mac에서는 열리지 만 ipad에서는 열 수 없음 – Swastik
+0
열기에 따라 열기를 의미합니까? doc 파일로 읽을 수 있거나 in을 열면 발견되어 앱 샌드 박스에 저장할 수 있습니까? –
관련 문제
- 1. PHP로 첨부 파일 보내기
- 2. iPhone/iPad에서 .doc .xls 파일 만들기/편집
- 3. 첨부 파일 첨부 보내기 PHP의 mail() 함수
- 4. Django에서 동일한 첨부 파일로 대량 이메일 보내기
- 5. powershell 바이너리 첨부 파일로 이메일 보내기
- 6. 이메일 첨부 파일 보내기 5.2.11
- 7. WCF에서 첨부 파일 보내기/받기
- 8. ActionMailer 3을 사용하여 html 첨부 파일 보내기
- 9. 보내기 첨부
- 10. pdf를 doc 파일로 변환
- 11. 첨부 파일로 RDLC 보고서에 PDF 파일 삽입
- 12. 이메일에 첨부 된 CSV 파일 보내기
- 13. WCF를 사용하여 전자 메일로 첨부 파일 보내기
- 14. SMTPLIB.data()를 사용하여 첨부 파일 보내기
- 15. Xcode : 전자 메일 첨부 파일로 MKmapView의 스크린 샷 보내기
- 16. 전자 메일 Asp.Net을 통해 첨부 파일로 부분 페이지 보내기
- 17. jsp를 doc 파일로 내보내려면 어떻게해야합니까?
- 18. cron : 파일로 출력 보내기 다음 이메일로 파일 보내기
- 19. PHP 메일() 함수를 통해 간단한 첨부 파일 보내기
- 20. C# 첨부 파일이있는 메일 보내기
- 21. 빌드 출력을 첨부 파일로 포함합니다.
- 22. 종이 클립 첨부 파일
- 23. CRM 첨부 파일
- 24. 첨부 파일을 하나의 파일로 다운로드
- 25. 첨부 파일로 GD 이미지 다운로드
- 26. javamail은 첨부 파일을 보내기 전에 메모리에로드합니까?
- 27. PDF 첨부 파일이있는 Php로 메일 보내기
- 28. WYSIWYG에서 doc 파일 추출
- 29. 이메일에 첨부 파일 phpmailer
- 30. 첨부 파일이있는 전자 메일 보내기
이 파일은 기존 .doc 파일입니까, 아니면 동적으로 생성 된 파일입니까? –
내 응용 프로그램을 통해 동적으로 생성 오전 – Swastik