tags:

views:

47

answers:

1

i am attaching image in email.but how can we attach html file in email ? here is code by which i am attaching image file in an email.

UIImage *artworkImage = viewImage;
NSData *artworkJPEGRepresentation = nil;
if (artworkImage) 
{
 artworkJPEGRepresentation = UIImageJPEGRepresentation(artworkImage, 0.7);
}
if (artworkJPEGRepresentation)
{
 [composeVC addAttachmentData:artworkJPEGRepresentation mimeType:@"image/jpeg" fileName:@"Image.jpg"];
}
[self presentModalViewController:composeVC animated:YES];
[composeVC release];

How can we attach HTML in a same way.

I don't want to set HTML as body ,i want to send HTML as attachment.

kindly guide me regarding this issue.

A: 

Have you tried attaching it in the same way you have done with the image:

NSData* htmlAttach = [NSData dataWithContentsOfFile:@"html-file.html"];
[composeVC addAttachmentData:htmlAttach
                    mimeType:@"text/html"
                    fileName:@"html-file.html"
];
teabot
Yes,i have already tried this but it is not working it attach the html file in email but does not process that html.i mean it does not show what i have done in html like showing some message.
Can you clarify your question - you do not say how exactly you want the HTML to appear. As the body? As a file icon in the body? Something else - if so what?
teabot