2013-01-22 35 views

回答

0

您可以使用

for (UIImage *yourImage in YourImageArray) 
{ 
      NSData *imgData = UIImageJPEGRepresentation(yourImage, 0.5); 
      [mfMailComposer addAttachmentData:imgData mimeType:@"image/jpeg" fileName:[NSString 
      stringWithFormat:@"a.jpg"]]; 
} 
0

最好的办法是

[mailCompose setMessageBody: msg isHTML: YES]; 

其中msg具有价值:

<body> 
<img src='http://your_site/image1.jpg'> 
<img src='http://your_site/image2.jpg'> 
<br/> 

<font face='Arial' size='2'> 
    Message Text<br/> 

    <br/> 
</font> 

2

可以Firest创建要与电子邮件attech什么imageFull通道阵列和不喜欢波纹管: -

- (IBAction)sendemail 
{ 

    Class mailClass = (NSClassFromString(@"MFMailComposeViewController")); 
    if (mailClass != nil) 
    { 
     // We must always check whether the current device is configured for sending emails 
     if ([mailClass canSendMail]) 
     { 


      MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init]; 
      picker.mailComposeDelegate = self; 
      [picker setSubject:@"Hello"]; 
      //NSString *result = txtFiled.text; 
      for(NSString *dicsss in buttonss) // Hear buttonss its a ImagePathfull array 
      { 
       UIImage *imgvith = [UIImage imageWithContentsOfFile:[buttonss stringByAppendingPathComponent:dicsss]]; 
       NSData *data = UIImagePNGRepresentation(imgvith); 
       [picker addAttachmentData:data mimeType:@"image/png" fileName:@"yourImagename"]; 

      } 


      NSString *emailBody = @"Hi"; 
      [picker setMessageBody:emailBody isHTML:YES]; 
      [self presentModalViewController:picker animated:YES]; 
      [picker release]; 
     } 


} 

工作的代码截图如下所示: -

enter image description here

相关问题