iphone - iOS text file corrupt when sent via Google hosted mail server to Mac / iOS email client -


i create text file in ios app , email attachment. receive on mac (or ios client). if emails sent apple hosted mailbox (e.g. xxx@me.com) fine. if file sent google hosted mail account such xxx@mydomain.com corrupt (big time).

this code:

....  mfmailcomposeviewcontroller* mailcontroller = [[mfmailcomposeviewcontroller alloc] init]; mailcontroller.mailcomposedelegate = self; [mailcontroller setsubject:@"some subject"]; [mailcontroller setmessagebody:@" " ishtml:no]; [mailcontroller addattachmentdata:fileasdata mimetype:@"text/plain" filename:@"filename.txt"];  .... 

to make more confusing if send email gmail hosted account (e.g. xxx@gmail.com) fine.

finally if use standard mail client on ipad / iphone , attach same file icloud drive using new ios9 "add attachment" functionality attaching files fine.

so figure combination of (1) how create email , attach file programatically , (2) google email hosting service. maybe can't see wood trees.


Comments