Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Mobile-Applications MFMailComposeViewController image attachment
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Java Coder
MFMailComposeViewController image attachment
1 Answer(s)      3 years and 6 months ago
Posted in : MobileApplications


How can we attach an image in MFMailComposeViewController?


Advertisement
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
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 Here Thanks
sending mail with attachment in jsp - JSP-Servlet
sending mail with attachment in jsp  Hi Experts
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
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
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
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
Read attachment message using Java Mail
Read attachment message using Java Mail   ... a Attachment message using javamail api. Java Mail API provides classes to send multiple... or image. All message are stored in Folder objects. folders can contain folders
How to set attachment from browse button to send mails using java mail api
How to set attachment from browse button to send mails using java mail api... in jsp and servlet in that i have to make attachment option available using browse button but attachment is not loading properly using browse button because
Image Steganography
Image Steganography  SOURCE CODE FOR IMAGE STEGANOGRAPHY
image scrolling
image scrolling  A brief description of scrolling image
image format
image format  what are the different format available in image
image format
image format  what are the different format available in image
To scan a image encode that image in j2me
To scan a image encode that image in j2me  Hai team i am new man of j2me i have doubt to scan a image and encode the image in j2me... Please clarify that doubt... Thanks in Advance... Kumar
image scrambling
image scrambling  Hi frinds : i want to read image and scrambling it then saved using java any help please
Image_creation
Image_creation  how to create an image from a set of pixel values stored in array - in java
image in database
image in database  how to set image in database and retrieve it using servlet(java)in msaccess
Image processing
Image processing  i want a browsing program in java in which we hv a small img and we hv to browse this img on a big image so that we can find the similar type of image in big img
image Processing
image Processing   BCIF Image Compresssion Algorithm s alossless image Compression algorithm ,Pleas Help Me weather it can support only 24 bit bmp images
 

 

 

DMCA.com