相关疑难解决方法(0)

如何在MFMailComposeViewController的MailComposer Sheet中添加UIImage

我想在一个UIImage组合表中插入一个s MFMailComposerViewController.

请注意我不想附加它们,但我想使用HTML代码将它们放在一个表格中,这将是电子邮件正文的一部分.

iphone attachment ios mfmailcomposeviewcontroller

53
推荐指数
2
解决办法
3万
查看次数

如何在iPhone的MFMailComposeViewController中将图像嵌入到html中

我想在html表中嵌入一堆小图像,我想用MFMailComposeViewController发送它.在做了一些搜索之后,我发现几乎所有人都建议使用"Matt Gallagher的NSData + Base64"类来编码Base64encoding中的照片并将其嵌入到html中.虽然它看起来适用于iPhone和一些电子邮件服务器,但Gmail和Yahoo不会以这种方式显示嵌入的图像.这里也提到这个问题.

我想知道是否有人有更好的解决方案.我不想在网上上传照片并将链接放在html代码中.我想将图像附加到电子邮件中,并在html文本,表格中显示为内嵌图像,...

html iphone inline photo image

16
推荐指数
2
解决办法
8980
查看次数

在Ios上的html电子邮件中显示base64图像

我生成一个包含base64图像的html字符串.当MFMailComposeViewController打开时,我会看到生成的电子邮件中的图像.当我发送并打开它时,图像不会显示,只有空方块.

我的代码

- (IBAction)actionShareByEmail:(id)sender {

    if([MFMailComposeViewController canSendMail])
    {
        MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
        picker.mailComposeDelegate = self;

        NSString* subject = @"Environments list with qrcode";
        [picker setSubject:subject];
        [picker setMessageBody:[manager getHtmlWithEnvironments:nil] isHTML:YES];
        [self presentViewController:picker animated:YES completion:nil];
    }
}

-(NSString*)getHtmlWithEnvironments:(NSArray*)envDictionnaries{
    NSMutableString* html = [[NSMutableString alloc]init];
    [html appendString: @"<html><body>"];

    for (NSDictionary *d in self.arEnvironments) {

        UIImage* qrcode = [QRCodeGenerator qrImageForString:[d objectForKey:@"env_name"] imageSize:200.0];//Works fine
        NSData *imageData = UIImagePNGRepresentation(qrcode);
        NSString *encodedString = [imageData base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength];
        [html appendString: [NSString stringWithFormat:@"<H3>%@</h3><img src=\"data:image/png;base64,%@\" width=\"200\" height=\"200\" alt=\"test\" /></br></br>",[d objectForKey:KEY_ENV_NAME],encodedString]];
    }
    [html …
Run Code Online (Sandbox Code Playgroud)

html email base64 objective-c uiimage

8
推荐指数
1
解决办法
2229
查看次数