I am using the MFMailComposeViewController class to send formatted HTML emails from an iPhone application. I need to include an image in an email, and I added an IMG tag to my email address
- (IBAction)shareWithOther
{
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
[picker setSubject:@"My Message Subject"];
NSString *emailBody = @"<h3>Some and follow by an image</h3><img src=\"SG10002_1.jpg\"/>and then more text.";
[picker setMessageBody:emailBody isHTML:YES];
[self presentModalViewController:picker animated:YES];
[picker release];
}
the image file, "SG10002_1.jpg" was added to my resource folder, but the image did not appear in the message body (only displayed as [?]). Can someone please tell me what I am doing wrong if the image path is wrong or is there a better way to do this?
Many thanks.
source
share