当图像处于条形码状态时,无法在Outlook中嵌入嵌入式图像 [英] Cannot embed inline image in outlook when image is in barcode

查看:95
本文介绍了当图像处于条形码状态时,无法在Outlook中嵌入嵌入式图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个条形码图像,并将其转换为数据流,并内联嵌入并通过smtp邮件传递.现在,收件人可以在网络邮件中看到该条形码,但是看不到它以红叉(x)的形式出现. 任何帮助都将受到高度赞赏.

I have created one barcode image and convert it in data stream and embed it inline and pass it through smtp mail. Now recipient can able to see that barcode in webmail, but cannot able to see it outlook it is coming as red cross (x). Any help is highly appreciated.

private string MyMethod(string myInputStr) 
{
       var myBarcodeObj = new Barcode(); 
       string myString = string.Format("{0}\t", myInputStr); 
       byte[] myGeneratedCode = myBarcodeObj.GenerateCode(myString); 
       string myBase64ImageString = ConvertBytesToBase64(myGeneratedCode ); 
       objBEorder.ERPOrder.ImgBarcode = new System.Web.UI.WebControls.Image() 
      { 
       ImageUrl = "data:image/jpg;base64," + myBase64ImageString 
      };
}
private string ConvertBytesToBase64(byte[] imageBytes) 
        { 
            return Convert.ToBase64String(imageBytes); 
        }

推荐答案

HTML图像由Word在Outlook中呈现,并且不支持嵌入式("data:image/jpg; base64)图像.

HTML images are rendered by Word in Outlook, and it does not support embedded ("data:image/jpg;base64) images.

将图像添加为附件并设置其Content-ID MIME标头. HTML正文应使用cid属性(<img src="cid:xyz">)

Add the image as an attachment and set its Content-ID MIME header. The HTML body should refer to the image thorugh the cid attribute (<img src="cid:xyz">)

这篇关于当图像处于条形码状态时,无法在Outlook中嵌入嵌入式图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆