ios - MFMailComposeViewController Large Pdfs attachments get stuck -


so using mfmailcomposeviewcontroller attach pdf files email , send out using default ios mail app set exchange account.

if send file size 4863k works perfectly. goes off expected.

if send file size 5688k seems working , gets mfmailcomposeresultsent result sent delegate.

however, mail never arrives , when in mail app, see stuck in outbox error of:

the server rejected message

what's super weird when try resent message outbox, sends out fine , gives no further error message.

i sort of @ wits end , have not first clue going wrong. cannot screw around apple's code, there don't seem many options mfmailcomposeviewcontroller possibly have screwed up.

the code straightforward:

- (void) setattachments:(nsarray*)attatchments                 ofdraft:(mfmailcomposeviewcontroller*)draft {   if (attatchments)   {     (nsstring* path in attatchments)     {         nsdata* data = [self getdataforattachmentpath:path];          nsstring* basename = [self getbasenamefromattachmentpath:path];         nsstring* pathext  = [basename pathextension];         nsstring* filename = [basename pathcomponents].lastobject;         nsstring* mimetype = [self getmimetypefromfileextension:pathext];          // couldn't find mimetype, must type of binary data         if (mimetype == nil) mimetype = @"application/octet-stream";          [draft addattachmentdata:data mimetype:mimetype filename:filename];     }   } } 

the fact works smaller files implies me there nothing wrong code , copied out of cordova plugin sees pretty wide usage. whatever reason, files on ~5mb fail no apparent reason.

thanks help.

update captured http traffic , discovered in situation mail sent using mfmailcomposeviewcontroller, post request has content-length of 0, not allowed, server returns 400 error. when try resend same message mail app directly, content-length size expected.

this appears limitation of messageui framework, cannot verify there universal limitation imposed apple.


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

css - Can I use the :after pseudo-element on an input field? -