In my app, I need to attach a video using SKPSMTPMessage. At first, I learned from Dunja's code,
NSData *videoData = [NSData dataWithContentsOfFile: videoPath];
NSDictionary *videoPart = [NSDictionary dictionaryWithObjectsAndKeys:@"video/quicktime;\r\n\tx-unix-mode=0644;\r\n\tname=\"video.mov\"",kSKPSMTPPartContentTypeKey,
@"attachment;\r\n\tfilename=\"video.mov\"",kSKPSMTPPartContentDispositionKey,[videoData encodeBase64ForData],kSKPSMTPPartMessageKey,@"base64",kSKPSMTPPartContentTransferEncodingKey,nil];
but it's just can't work out. I tried all the solutions as I can imagined. Finally, I changed the encode type of videoData: from
... [videoData encodeBase64ForData],kSKPSMTPPartMessageKey ...
to
... [videoData encodeWrappedBase64ForData],kSKPSMTPPartMessageKey ...
and it works!
I have no idea what's the difference between this two api, can anyone help me out? Thank Dunja again, I learned a lot from your code.