MFMailComposeViewController image attachment

MFMailComposeViewController image attachment

How can we attach an image in MFMailComposeViewController?

View Answers

July 7, 2011 at 1:21 PM

- (void)createEmail {
   NSMutableString *emailBody = [[[NSMutableString alloc] initWithString:@"<html><body>"] retain];
   [emailBody appendString:@"<p>Some email body text can go here</p>"];
   UIImage *emailImage = [UIImage imageNamed:@"myImageName.png"];
   NSData *imageData = [NSData dataWithData:UIImagePNGRepresentation(emailImage)];
 
   NSString *base64String = [imageData base64EncodedString];
  [emailBody appendString:[NSString stringWithFormat:@"<p><b><img src='data:image/png;base64,%@'></b></p>",base64String]];
  [emailBody appendString:@"</body></html>"];
    NSLog(@"%@",emailBody);

 //mail composer window
    MFMailComposeViewController *emailDialog = [[MFMailComposeViewController alloc] init];
    emailDialog.mailComposeDelegate = self;
    [emailDialog setSubject:@"My Inline Image Document"];
    [emailDialog setMessageBody:emailBody isHTML:YES];

    [self presentModalViewController:emailDialog animated:YES];
    [emailDialog release];
    [emailBody release];
}









Related Tutorials/Questions & Answers:
MFMailComposeViewController image attachment
MFMailComposeViewController image attachment  How can we attach an image in MFMailComposeViewController
mfmailComposeViewController link
mfmailComposeViewController link  Is there any way to get a hyperlink on email text using mfmailComposeViewController in my iPhone application?  .... MFMailComposeViewController also support it. See the below given code
Advertisements
iPhone - MFMailcomposeviewcontroller example
iPhone - MFMailcomposeviewcontroller example  Hi! I'm looking for a mfmailcomposeviewcontroller example for both iPhone and iPad. Any suggestion?? Thanks
_OBJC_CLASS_$_MFMailComposeViewController", referenced from:
_OBJC_CLASS_$_MFMailComposeViewController", referenced from:   While configuring the email feature in my ipad application, i get the following error message. "OBJCCLASS$MFMailComposeViewController", referenced from: Can
php send mail with attachment
php send mail with attachment  Syntax of sending email with attachment in PHP
Webservices with attachment on websphere - WebSevices
Webservices with attachment on websphere  Need some help urgently!!! I need to provide an interface with webservices to access one of our services...). 2. Have some one some example ready for attachment with webservices
upload attachment - Spring
upload attachment  java code in register form to upload an attachment storing in blog and clog   Hi Friend, Are you using JSP or Java Swings? Please clarify this. Thanks
send the mail with attachment - Struts
send the mail with attachment   Hi Freinds, i am sending the mail without attachment file now. But i need to send the mail with attachment in struts. when i added the attachemt logic in struts,i am not able to send
AXIS ATTACHMENT MISSING - WebSevices
AXIS ATTACHMENT MISSING  Hi, i have a method which takes a filename... the attachment before returning. Kindly guide. Following is the server side code...(); // create an attachment and set its mime type AttachmentPart
ModuleNotFoundError: No module named 'anyblok_attachment'
ModuleNotFoundError: No module named 'anyblok_attachment'  Hi, My... named 'anyblok_attachment' How to remove the ModuleNotFoundError: No module named 'anyblok_attachment' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'attachment-downloader'
ModuleNotFoundError: No module named 'attachment-downloader'  Hi...: No module named 'attachment-downloader' How to remove the ModuleNotFoundError: No module named 'attachment-downloader' error? Thanks   Hi
ModuleNotFoundError: No module named 'attachment-downloader'
ModuleNotFoundError: No module named 'attachment-downloader'  Hi...: No module named 'attachment-downloader' How to remove the ModuleNotFoundError: No module named 'attachment-downloader' error? Thanks   Hi
ModuleNotFoundError: No module named 'anyblok_attachment'
ModuleNotFoundError: No module named 'anyblok_attachment'  Hi, My... named 'anyblok_attachment' How to remove the ModuleNotFoundError: No module named 'anyblok_attachment' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'attachment-downloader'
ModuleNotFoundError: No module named 'attachment-downloader'  Hi...: No module named 'attachment-downloader' How to remove the ModuleNotFoundError: No module named 'attachment-downloader' error? Thanks   Hi
ModuleNotFoundError: No module named 'kinto-attachment'
ModuleNotFoundError: No module named 'kinto-attachment'  Hi, My... named 'kinto-attachment' How to remove the ModuleNotFoundError: No module named 'kinto-attachment' error? Thanks   Hi, In your
image
image  how to add the image in servlet code
Image
Image  how to insert image in xsl without using xml. the image was displayed in pdf..Please help me
Image
Image  how to insert image in xsl without using xml. the image was displayed in pdf..Please help me
Image
Image  how to insert image in xsl without using xml. the image was displayed in pdf..Please help me
To insert attachment file in database in JSP.
To insert attachment file in database in JSP.  I am doing project in JSP. How to insert attachment file in mysql database? Please suggest some solution. Your inputs is valuable to me.   Hi Friend, Visit HereADS
sending mail with attachment in jsp - JSP-Servlet
sending mail with attachment in jsp  Hi Experts
image
image   Dear every body please help me how to add and retrive image and video into oracle 11g using jsp
Sending Email with Attachment
Sending Email with Attachment       This Example shows you how to send a Attachment in the message using... attachment in the content and Finally, it sends the Message by invoking
send the mail with attachment problem - Struts
send the mail with attachment problem  Hi friends, i am using... InternetAddress(to)); message.setSubject("JavaMail Attachment...(messageBodyPart); // Part two is attachment messageBodyPart
ModuleNotFoundError: No module named 'anyblok_attachment_jinja'
ModuleNotFoundError: No module named 'anyblok_attachment_jinja'  Hi...: No module named 'anyblok_attachment_jinja' How to remove the ModuleNotFoundError: No module named 'anyblok_attachment_jinja' error? Thanks  
ModuleNotFoundError: No module named 'odoo10-addon-attachment-base-synchronize'
ModuleNotFoundError: No module named 'odoo10-addon-attachment-base-synchronize...: ModuleNotFoundError: No module named 'odoo10-addon-attachment-base-synchronize' How to remove the ModuleNotFoundError: No module named 'odoo10-addon-attachment
ModuleNotFoundError: No module named 'odoo10-addon-attachment-preview'
ModuleNotFoundError: No module named 'odoo10-addon-attachment-preview' ...: ModuleNotFoundError: No module named 'odoo10-addon-attachment-preview' How to remove the ModuleNotFoundError: No module named 'odoo10-addon-attachment-preview' error
ModuleNotFoundError: No module named 'odoo10-addon-attachment-base-synchronize'
ModuleNotFoundError: No module named 'odoo10-addon-attachment-base-synchronize...: ModuleNotFoundError: No module named 'odoo10-addon-attachment-base-synchronize' How to remove the ModuleNotFoundError: No module named 'odoo10-addon-attachment
ModuleNotFoundError: No module named 'odoo10-addon-attachment-preview'
ModuleNotFoundError: No module named 'odoo10-addon-attachment-preview' ...: ModuleNotFoundError: No module named 'odoo10-addon-attachment-preview' How to remove the ModuleNotFoundError: No module named 'odoo10-addon-attachment-preview' error
ModuleNotFoundError: No module named 'odoo11-addon-attachment-unindex-content'
ModuleNotFoundError: No module named 'odoo11-addon-attachment-unindex-content...: ModuleNotFoundError: No module named 'odoo11-addon-attachment-unindex-content' How to remove the ModuleNotFoundError: No module named 'odoo11-addon-attachment
ModuleNotFoundError: No module named 'odoo11-addon-attachment-base-synchronize'
ModuleNotFoundError: No module named 'odoo11-addon-attachment-base-synchronize...: ModuleNotFoundError: No module named 'odoo11-addon-attachment-base-synchronize' How to remove the ModuleNotFoundError: No module named 'odoo11-addon-attachment
ModuleNotFoundError: No module named 'odoo11-addon-attachment-preview'
ModuleNotFoundError: No module named 'odoo11-addon-attachment-preview' ...: ModuleNotFoundError: No module named 'odoo11-addon-attachment-preview' How to remove the ModuleNotFoundError: No module named 'odoo11-addon-attachment-preview' error
ModuleNotFoundError: No module named 'odoo11-addon-attachment-unindex-content'
ModuleNotFoundError: No module named 'odoo11-addon-attachment-unindex-content...: ModuleNotFoundError: No module named 'odoo11-addon-attachment-unindex-content' How to remove the ModuleNotFoundError: No module named 'odoo11-addon-attachment
ModuleNotFoundError: No module named 'odoo12-addon-attachment-unindex-content'
ModuleNotFoundError: No module named 'odoo12-addon-attachment-unindex-content...: ModuleNotFoundError: No module named 'odoo12-addon-attachment-unindex-content' How to remove the ModuleNotFoundError: No module named 'odoo12-addon-attachment
ModuleNotFoundError: No module named 'odoo12-addon-autovacuum-message-attachment'
-attachment'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'odoo12-addon-autovacuum-message-attachment...-autovacuum-message-attachment' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'odoo12-addon-autovacuum-message-attachment'
-attachment'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'odoo12-addon-autovacuum-message-attachment...-autovacuum-message-attachment' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'odoo12-addon-autovacuum-message-attachment'
-attachment'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'odoo12-addon-autovacuum-message-attachment...-autovacuum-message-attachment' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'odoo12-addon-muk-attachment-lobject'
ModuleNotFoundError: No module named 'odoo12-addon-muk-attachment-lobject' ...: ModuleNotFoundError: No module named 'odoo12-addon-muk-attachment-lobject' How to remove the ModuleNotFoundError: No module named 'odoo12-addon-muk-attachment
ModuleNotFoundError: No module named 'odoo12-addon-muk-attachment-lobject'
ModuleNotFoundError: No module named 'odoo12-addon-muk-attachment-lobject' ...: ModuleNotFoundError: No module named 'odoo12-addon-muk-attachment-lobject' How to remove the ModuleNotFoundError: No module named 'odoo12-addon-muk-attachment
ModuleNotFoundError: No module named 'odoo12-addon-muk-dms-attachment'
ModuleNotFoundError: No module named 'odoo12-addon-muk-dms-attachment' ...: ModuleNotFoundError: No module named 'odoo12-addon-muk-dms-attachment' How to remove the ModuleNotFoundError: No module named 'odoo12-addon-muk-dms-attachment' error
ModuleNotFoundError: No module named 'odoo8-addon-attachment-action'
ModuleNotFoundError: No module named 'odoo8-addon-attachment-action'  ...: No module named 'odoo8-addon-attachment-action' How to remove the ModuleNotFoundError: No module named 'odoo8-addon-attachment-action' error
ModuleNotFoundError: No module named 'odoo8-addon-attachment-edit'
ModuleNotFoundError: No module named 'odoo8-addon-attachment-edit'  ...: No module named 'odoo8-addon-attachment-edit' How to remove the ModuleNotFoundError: No module named 'odoo8-addon-attachment-edit' error? Thanks
ModuleNotFoundError: No module named 'odoo8-addon-attachment-lock'
ModuleNotFoundError: No module named 'odoo8-addon-attachment-lock'  ...: No module named 'odoo8-addon-attachment-lock' How to remove the ModuleNotFoundError: No module named 'odoo8-addon-attachment-lock' error? Thanks
ModuleNotFoundError: No module named 'odoo8-addon-attachment-metadata'
ModuleNotFoundError: No module named 'odoo8-addon-attachment-metadata' ...: ModuleNotFoundError: No module named 'odoo8-addon-attachment-metadata' How to remove the ModuleNotFoundError: No module named 'odoo8-addon-attachment-metadata' error
ModuleNotFoundError: No module named 'odoo8-addon-attachment-preview'
ModuleNotFoundError: No module named 'odoo8-addon-attachment-preview' ...: No module named 'odoo8-addon-attachment-preview' How to remove the ModuleNotFoundError: No module named 'odoo8-addon-attachment-preview' error
ModuleNotFoundError: No module named 'odoo9-addon-attachment-base-synchronize'
ModuleNotFoundError: No module named 'odoo9-addon-attachment-base-synchronize...: ModuleNotFoundError: No module named 'odoo9-addon-attachment-base-synchronize' How to remove the ModuleNotFoundError: No module named 'odoo9-addon-attachment
ModuleNotFoundError: No module named 'redsolutioncms.django-tinymce-attachment'
ModuleNotFoundError: No module named 'redsolutioncms.django-tinymce-attachment...: ModuleNotFoundError: No module named 'redsolutioncms.django-tinymce-attachment' How...-tinymce-attachment' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'anyblok_attachment_jinja'
ModuleNotFoundError: No module named 'anyblok_attachment_jinja'  Hi...: No module named 'anyblok_attachment_jinja' How to remove the ModuleNotFoundError: No module named 'anyblok_attachment_jinja' error? Thanks  
To insert attachment file in database in JSP.
To insert attachment file in database in JSP.  I am doing project in JSP. How to insert attachment file in mysql database? Please suggest some solution. Your inputs is valuable to me.   Hi Friend, Try the following
sending mail with attachment in jsp - JSP-Servlet
sending mail with attachment in jsp  Hi, Can any one pls tell me how to send email with attachment in jsp. I know how to send mail without attachment but with attachment its not working for me. If u hve any idea please

Ads