I am trying to attach images to the email and send the email to my email add. The problem is that when i send out an email with 4 or 5 images attached, the app keeps processing for ever and eventually gets hanged and crashes and doesn't send the email. It is working fine with one image. I am thinking it is because of the size of the images combined together. Btw, I am using iOS 6.. How do i restrict the size of the files or images sent? Or there might be other issues involved? The same app is working in ios5....
The email sending portion together with image is:
for (int nCtr = 0; nCtr < [Pix count]; nCtr++) {
UIImageView *imageV = [Pix objectAtIndex:nCtr];
if (imageV.image) {
NSData *imageData = UIImagePNGRepresentation(imageV.image);
NSString *strFileName = [NSString stringWithFormat:@"MyPicture-%d.jpeg",nCtr];
NSString *strFormat = [NSString stringWithFormat:@"image/jpeg;\r\n\tx-unix-mode=0644;\r\n\tname=\"%@\"",strFileName];
NSString *strFormat2 = [NSString stringWithFormat:@"attachment;\r\n\tfilename=\"%@\"",strFileName];
NSDictionary *vcfPart = [NSDictionary dictionaryWithObjectsAndKeys:strFormat,kSKPSMTPPartContentTypeKey,
strFormat2,kSKPSMTPPartContentDispositionKey,[imageData encodeBase64ForData],kSKPSMTPPartMessageKey,@"base64",kSKPSMTPPartContentTransferEncodingKey,nil];
[images addObject:vcfPart];
}