Friday 26 April 2013

How to send the Animated Image(.gif) thru Email in iOS?

Hi all,
     I want to post the animated image thru Email.But when I use the link of animated image, then  the image is animated in Email body.
I used below code for sending animated image (http://php.eminosoft.com/emoji/images/beautiful.gif is having the animated image).

Code:

 MFMailComposeViewController *mailView = [ [MFMailComposeViewController alloc]init];
  if([MFMailComposeViewController canSendMail])
  {
          mydata = [[NSData alloc]initWithContentsOfURL:[NSURL URLWithString:http://php.eminosoft.com/emoji/images/beautiful.gif]]];
         [mailView setSubject:@"Emoji app"];
            
            [mailView addAttachmentData:mydata mimeType:@"image/gif" fileName:@"beautiful"];
           
            mailView.mailComposeDelegate = self;
            [self presentModalViewController:mailView animated:YES];
            [mydata release];
            [mailView release];


Is there any other ways to send the animated image with out using the link.

Thanks in Advance..

No comments:

Post a Comment