Using MVCMailer to embed images in the email

How do you use MVCMailer to embed images in e-mail?

I tried something in the lines

<img src="@Url.Abs("\\..\\images\logo.png")" \> 

without success.

Any examples?

thanks

+4
source share
3 answers

Look at MvcMailer wiki

https://github.com/smsohan/MvcMailer/wiki/MvcMailer-Step-by-Step-Guide

search for Embed Image, and you do this!

+5
source

Try it like this:

 <img src="@Url.Abs(Url.Content("~/images/logo.png")" /> 

Also make sure that the absolute URL-address generated by this assistant, is available when you open the email in your email client. For example, if you placed the ASP.NET MVC application on the local visual studio web server, make sure that it works when you are trying to read the letter as the image must be available.

+3
source

You need to collect all the URL, where your image, and it should be posted on the Internet.

For example, I want to insert an image, which is called Logo.png, and it is located in the folder "Pictures" in my project, I will write in my submission MvcMailer:

 <img src="http://mywebsite.com/Images/Logo.png" /> 
+1
source

All Articles