PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, July 18, 2022

[FIXED] How to add gif to attachment in iPhone mail?

 July 18, 2022     attachment, email, gif, ios     No comments   

Issue

I add .jpg this way:

UIImage *sentPic = self.image;
NSData *imageData = UIImageJPEGRepresentation(sentPic, 1);
[picker addAttachmentData:imageData mimeType:@"image/jpg" fileName:@"pic.jpg"];

I change it to "image/gif".But it doesn't work fine. Th Gif is just a still image in the mail.


Solution

NSData *imageData = [[NSData alloc] initWithContentsOfFile:pathToGifFile];
[picker addAttachmentData:imageData mimeType:@"image/gif" fileName:@"pic.gif"];
[imageData release];

This would add it as attachment, but I'm not sure if that's what you want, or you want to display the image inside the message?



Answered By - Filip Radelic
Answer Checked By - Pedro (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing