SendGrid - Image not showing up in HTML email
<p>I am using the SendGrid v3 API and C# library (v7) to send an email.
In my email I have a header which is a png. The header is embedded like this:</p>

<pre><code>&lt;img src="cid:emailheader"/&gt;
</code></pre>

<p>In the C# code I send the image as an attachment with with the same ContentId</p>

<p>var mail = new Mail(from, subject, to, content);</p>

<pre><code>var headerPath = HttpContext.Current.Server.MapPath("~/Resources/email-header.png");

var attachment = new SendGrid.Helpers.Mail.Attachment();
attachment.ContentId = "emailheader";
attachment.Content = Convert.ToBase64String(File.ReadAllBytes(headerPath));
attachment.Type = "image/png";
attachment.Filename = "email-header.png";
mail.AddAttachment(attachment);

var send = sg.client.mail.send.post(requestBody: mail.Get());
</code></pre>

<p>Yet when I open the email it says the source is not found, even though the image is correctly displayed in the attachment</p>

<p><a href="https://i.stack.imgur.com/C2unN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/C2unN.png" alt="enter image description here"></a></p>