in Education by
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
image", 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); JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
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
image", 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);

Related questions

0 votes
    I am using C#.Net to send out a HTML email which contains embedded images. These emails work fine ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    Email users who use IE as their _________________ are vulnerable to Reaper Exploit. (a) Web engine (b) ... -for-Cyber Security:,Cyber Security-Jobs:,Cyber Security Applications...
asked Nov 1, 2021 in Education by JackTerrance
0 votes
    I am trying to concatenate two fields from a list to display in a dropdown. Below is the code i ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 27, 2022 in Education by JackTerrance
0 votes
    I want put perfect percentage on each chart column as shown in fig in C# Windows Forms. How would ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 6, 2022 in Education by JackTerrance
0 votes
    I want put perfect percentage on each chart column as shown in fig in C# Windows Forms. How would ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 26, 2022 in Education by JackTerrance
0 votes
    I want to be able to compare an image taken from a webcam to an image stored on my computer. The ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 10, 2022 in Education by JackTerrance
0 votes
    On the left you will notice the google logo rendered by IE, I drew a black line at the top and ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    On the left you will notice the google logo rendered by IE, I drew a black line at the top and ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    On the left you will notice the google logo rendered by IE, I drew a black line at the top and ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 10, 2022 in Education by JackTerrance
0 votes
    I am going through a ASP C# book and doing the tutorials. However I have encountered a problem. I ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    I want create expression with reflection in c#. I am target script is: using (var service = new ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 14, 2022 in Education by JackTerrance
0 votes
    Hi Folks i was googling one more hours.i did not find anything relevant, I have text File like ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 14, 2022 in Education by JackTerrance
0 votes
    I built an OCR application which reads PDF files and OCR's them. I built it using Multi-threading ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 17, 2022 in Education by JackTerrance
0 votes
    Designing a registration form, and I get this error when adding in MessageBoxButtons and MessageBoxIcon. The error ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 15, 2022 in Education by JackTerrance
0 votes
    I have 2 Tables, Receipts which contains columns like Id, InvoiceId etc and Invoices, which Contains Id, ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 10, 2022 in Education by JackTerrance
...