SMTP mail not displaying the image

2019-08-27 21:55发布

问题:

I am new to web api ,Here I am sending mail using SMTP service .

In this I need to send images I mean I need to display the image along with the mail contents.

But in my case contents are properly displaying but the image is not .

The data of image URL is : http://192.168.168.62:8087/Images/Product/My_Cart/axe_brand_1.jpg

When I inspect the image in the mail box it shows as follows:

 <img data-imagetype="External" src="/actions/ei?u=http%3A%2F%2F192.168.168.62%3A8087%2FImages%2FProduct%2FMy_Cart%2Faxe_brand_1.jpg&amp;d=2019-01-02T05%3A52%3A02.212Z" originalsrc="http://192.168.168.62:8087/Images/Product/My_Cart/axe_brand_1.jpg" data-connectorsauthtoken="1" data-imageproxyendpoint="/actions/ei" data-imageproxyid="">

I have tried many ways to solve this I can't .Can anyone help me to solve this .

Update :

c#:

 foreach (DataRow Row in dt.Tables[0].Rows)
                    {
                        LinkedResource res = new LinkedResource(Row["ITEM_IMAGE"].ToString());
                        res.ContentId = Guid.NewGuid().ToString();
                        string htmlBody = @"<img src='cid:" + res.ContentId + @"'/>";

                        tableRows.AppendFormat(mailBodyTemplate, htmlBody, Row["ITEM_NAME"], Row["ITEM_UOM"], Row["QUANTITY"], Row["ITEM_PRICE_WITH_GST"], Row["TOTAL_AMOUNT_WITH_GST"]);
                    }
   var mailBody = string.Format(PurchaseSummary, tableRows.ToString(), totalPrice);

Template :

<tr>
    <td align="center"><img src="{0}" /></td>
    <td>
        <table style="width:100%;margin-left:15px">
            <tr>
                <td align="right" style="width:50%">Product Name :</td>
                <td align="left" style="color:#32CD32;font-weight:bold;width:50%">{1}</td>
            </tr>
            <tr>
                <td align="right" style="width:50%">Product UOM :</td>
                <td align="left" style="color:#696969;font-weight:bold;width:50%">{2}</td>
            </tr>
            <tr>
                <td align="right" style="width:50%">Quantity :</td>
                <td align="left" style="color:#778899;font-weight:bold;width:50%">{3}</td>
            </tr>
            <tr>
                <td align="right" style="width:50%">Unit Price :</td>
                <td align="left" style="color:#483D8B;font-weight:bold;width:50%">{4}
                <td>
            </tr>
        </table>
    </td>
    <td align="center" style="font-size:20px;font-weight:bold;color:#1E90FF">{5}</td>

</tr>

still it's not displaying the image .

While inspecting the image I got as follows..

<img data-imagetype="External" src="/actions/ei?u=http%3A%2F%2F192.168.168.62%3A8087%2FImages%2FProduct%2FMy_Cart%2Faxe_brand_1.jpg&amp;d=2019-01-02T09%3A41%3A12.195Z" originalsrc="http://192.168.168.62:8087/Images/Product/My_Cart/axe_brand_1.jpg" data-connectorsauthtoken="1" data-imageproxyendpoint="/actions/ei" data-imageproxyid="">