Base64 images to gmail

前端 未结 7 1467
再見小時候
再見小時候 2020-11-28 06:20

I\'m generating some inline images for an email sent from the iPad. Looks great in all desktop email clients, but gmail doesn\'t seem to like the base64 image and it shows u

7条回答
  •  南笙
    南笙 (楼主)
    2020-11-28 07:14

    MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
    
    [picker addAttachmentData:UIImageJPEGRepresentation(_tempImage,1) mimeType:mimeType fileName:filename];
    
    [picker setMessageBody:emailBody isHTML:YES];
    

    If isHTML is YES, addAttachmentData will auto change to base64 string, in email html can see you img.

    If isHTML is NO, addAttachmentData is attachment.

提交回复
热议问题