Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6168833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:45:22+00:00 2026-05-23T22:45:22+00:00

I am using C#.Net to send out a HTML email which contains embedded images.

  • 0

I am using C#.Net to send out a HTML email which contains embedded images. These emails work fine in Firefox and chrome but the images do not show up in Internet Explorer (IE). I know that the IE settings are not causing the problem since embedded images sent using Blat work just fine. Am I missing some option such as character set which is causing this problem? My code is as follows

 MailMessage msg = new MailMessage();
 MailAddress from = new MailAddress("Myemail@MyDomain", "My Name");
 msg.To.Add("Myemail@MyDomain");
 msg.From = from;
 msg.Subject = "My subjecct line";

 AlternateView htmlView = AlternateView.CreateAlternateViewFromString("This is a sample JPG embedded image<br><img src=\"cid:image1.jpg\">", null, "text/html");

 LinkedResource EmbeddedObjects1 = new LinkedResource("PathToImage\\image1.jpg");
 EmbeddedObjects1.ContentId = "image1.jpg";
 htmlView.LinkedResources.Add(EmbeddedObjects1);

msg.AlternateViews.Add(htmlView);
SmtpClient smtpclient = new SmtpClient("mailhost.domain.com", PortNumber);
smtpclient.Send(msg);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T22:45:22+00:00Added an answer on May 23, 2026 at 10:45 pm

    Maybe it helps if you create the LinkedResource with a ContentType combined with Coding Gorilla’s idea of a guid as the content-id:

    Guid contentId = Guid.NewGuid().ToString();
    
    AlternateView htmlView = AlternateView.CreateAlternateViewFromString(
      "This is a sample JPG embedded image<br><img src=\"cid:" + contentId + "\">", 
      null, "text/html");
    
    ContentType ct = new ContentType(MediaTypeNames.Image.Jpeg);
    
    LinkedResource EmbeddedObjects1 = new LinkedResource("PathToImage\\image1.jpg", ct);
    EmbeddedObjects1.ContentId = contentId;
    htmlView.LinkedResources.Add(EmbeddedObjects1);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I'm using System.Net.Mail to send some HTML formatted emails. What is the correct
I send email through Outlook using VB.Net 2005; this is working fine. At the
I'm trying to send an email message using the .NET MailMessage class which can
How can I send an email using SYstem.Net.Mail to an email address that is
I am attempting to send an email using VB.NET. There are two requirements: The
I have an App that will send authenticated emails using System.Net.Mail and System.Net.NetworkCredential my
I am trying to send an email in ASP.NET using system.net.mail the problem is
I am wondering what the best way to send bulk emails is using System.Net.Mail
I'm trying to send emails out using MIME::Lite with authentication. Here's the code snippet
In my web app, I send HTML emails to members, which contain links. Pretty

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.