0

I have embeded a user image in message body of MFMailComposeSheet in my iPhone app.

NSMutableString *messageBody = [[[NSMutableString alloc] initWithString:@"<html><body>"] retain];

NSData *imageData = [NSData dataWithData:UIImagePNGRepresentation(capturedProfileImage)];
NSString *base64String = [self base64forData:imageData];

[messageBody appendFormat:@"<p>&nbsp;&nbsp;&nbsp;&nbsp; %@.</p>",textMessage];
[messageBody appendFormat:@"<p>REGARDS</p>"];
[messageBody appendFormat:@"<p><b><img src='data:image/png;base64,%@'>  </b></p>", base64String];
[messageBody appendFormat:@"<p>&nbsp;&nbsp;&nbsp;&nbsp; %@.</p>",userName];
[messageBody appendFormat:@"<p>&nbsp;&nbsp;&nbsp;&nbsp; %@.</p>",userPhone];
[messageBody appendFormat:@"</body></html>"];

Require format is like as follows:

Sample screen

But the embedded image displayed in its actual size, and I need to display in 57x57 pixels. How do I fix the width and height of the image as 57x57?

user1645721
  • 653
  • 2
  • 8
  • 18
  • 1
    Have you tried setting the `width` and `height` on the `img` tag? – rckoenes Oct 19 '12 at 08:44
  • 1
    have you ever heard of using CAPITAL letters in your question, if you expect good answers at least have the curtesy to make your question as readable as possible. – dngfng Oct 19 '12 at 08:44

1 Answers1

0

Fixed:

[messageBody appendFormat:@"<p><b><img src='data:image/png;base64  , %@'  style='width:57px; height=57px;'>  </b></p>", base64String];
user1645721
  • 653
  • 2
  • 8
  • 18