est-il possible d'envoyer un fichier archive zip dans une pièce jointe à un courrier électronique en utilisant l'API mail?Utilisation du fichier ZipArchive Zip dans la pièce jointe de l'iphone mail?
3
A
Répondre
8
Try This .. Celui-ci a fonctionné pour moi
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init]; picker.mailComposeDelegate = self; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *WritableDBPath= [documentsDirectory stringByAppendingPathComponent:kFilename];
NSData *data = [NSData dataWithContentsOfFile:WritableDBPath];
[picker addAttachmentData:data mimeType:@"application/zip" fileName:@"/abc.zip"];
[picker setSubject:@"Database"];
[picker setMessageBody:@"Database testing" isHTML:NO];
[self presentModalViewController:picker animated:YES];
1
Oui, c'est possible.
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *WritableDBPath= [documentsDirectory stringByAppendingPathComponent:kFilename];
NSData *data = [NSData dataWithContentsOfMappedFile:WritableDBPath];
[picker addAttachmentData:data mimeType:@"text/richtext" fileName:@"/abc.zip"];
[picker setSubject:@"Database"];
[picker setMessageBody:@"Database testing" isHTML:YES];
[self presentModalViewController:picker animated:YES];
Vous pouvez choisir le chemin de fichier, le nom de fichier selon votre choix. Veuillez vérifier le type mime si ce n'est pas le cas.
:)
Questions connexes
- 1. Problème de pièce jointe d'un fichier e-mail binaire
- 2. PHP: taille du fichier de pièce jointe
- 3. fichier pièce jointe suppression
- 4. PHP mail() pièce jointe ne s'ouvre pas dans Mac mail
- 5. PHP ZipArchive - zip corrompu
- 6. PHP mail() pièce jointe est corrompu
- 7. Pièce jointe Sharepoint Supprimer Nom du fichier
- 8. PHP mail avec pièce jointe - fichier supplémentaire: partie 1.4
- 9. Mail provenant d'iSeries avec pièce jointe
- 10. problème avec la pièce jointe
- 11. image de pièce jointe à un mail .. comment dans android?
- 12. Pièce jointe Android Gmail
- 13. html email avec pièce jointe
- 14. Comment envoyer un fichier pièce jointe?
- 15. Vérifier la pièce jointe
- 16. formulaire de pièce jointe C#
- 17. Comment puis-je lancer l'activité e-mail d'android avec une pièce jointe jointe dans l'e-mail?
- 18. PHP mail() - HTML apparaît comme une pièce jointe une fois qu'une pièce jointe est ajoutée
- 19. Comment lire pièce jointe
- 20. postale avec pièce jointe
- 21. ATT00006.dat fichier attaché automatiquement dans la pièce jointe
- 22. Enregistrement de la pièce jointe
- 23. Aide !! Erreur MIME avec mail() et pièce jointe
- 24. Utilisation d'ActionChooser avec pièce jointe pour e-mail et application Facebook dans Android
- 25. sp_send_dbmail codage de pièce jointe
- 26. Comment envoyer .zip en pièce jointe par email sur un serveur Exchange?
- 27. HTML dans la pièce jointe iCal
- 28. Pièce jointe d'email en PHP?
- 29. Glisser-déposer d'une pièce jointe d'un fichier e-mail dans GroupWise à une application .NET
- 30. Envoyer une pièce jointe avec e-mail en utilisant WCF