I am trying to find out the best way to add an image inside the body of the email and not as attachment in ios.
1) Apple has provided a function \"addAttach
I've found that (at least in my case) a PNG will work in the message composer but NOT when the message is opened / received by the user.
Composer Dandily showing logo PNG image!
Viewer Not so much logo images over here.
(Occasionally there will be a light blue outline where the image should be.)
Using the HTML body string below and the conversion below that seems to do the trick.
Message Body HTML String using JPEG
NSString *body = [NSString stringWithFormat:
@"\
\
\
Check out the App!\
\
Isn't this a terriffic logo?!.\
\
\
\
CLICK ITTTTTTT! \
\
",
imageString, @"http://www.LOLamazingappLOL.com"];
Convert Image to string with JPEG Data
+ (NSString *)dataStringFromImage:(UIImage *)image
{
NSData *imgData = UIImageJPEGRepresentation(image, 1);
return [imgData base64EncodedStringWithOptions:kNilOptions];
}
Additional Info:
Thank you @Richard for the CORRECT answer to this question.