MVC 4, c#.net sending emails using ActionMailer.Net.Mvc.EmailResult using smtp server
using: _email_layout.cshtml
<!DOCTYPE html>
<html>
<head></head>
<body>
<img alt="header.png" src="cid:header.png" />
<div id="main">
@RenderBody()
</div>
</body>
</html>
in MailController.cs
ActionMailer.Net.Attachments.Inline.Add("header.png", System.IO.File.ReadAllBytes(System.Web.HttpContext.Current.Server.MapPath("~/Content/Images/pic.png")));
ActionMAiler.Net.Mvc.EmailResult v = Email("myemailview", modelforview);
Sending email with:
myEmail.DeliverAsync();
If sent to our company emails - image is shown in the email as expected.
If sent to gmail.com - inline pic.png is not in email. Instead there is kind-of place holder with "header.png" next to it and garbage text at the end of email.
- Is it possible to see how to see html body of resulting email ? Where is it in EmailResult object ?
- Any ideas why inline image does not go through to outside emails?
Many thanks