Email html image file

How can I send an html email with images in C #? Can I just set a direct link to the image on my server (something like <img src="http://mysite.ru/img.png" />) or do I need an image attaché, and then use the link to my attached file? Are there any examples or libraries ready to use? What about css files and scripts?

+3
source share
5 answers

For CSS, the inline style is usually used and does not have links to files, images on the other hand should be just links and not send by email. You just need to declare the email content as html and you are ready to go. JavaScript is also available. I use it for re-posting.

+2

( ), , .

:

<img src="http://go.com/go.gif" />

, , .

: http://www.systemnetmail.com/faq/2.6.aspx

+3

. http://en.wikipedia.org/wiki/MHTML:

MHTML, MIME HTML, , , (, , Flash-, Java , ) HTML- . MHTML HTML, MIME- multipart/related. HTML; , URL- base64. MHT, .mht Microsoft Word, Internet Explorer Opera. MHTML - , 1999 RFC 2557.

MHTML .

+2

, , MvcMailer.

Mvc Mailer :

MvcMailer MVC - . :

a) Razor/WebForms

b) -

c)

d) ViewBag ViewModel

e) URL-, Url.Abs

f) , ,

g) . MvcMailer MailerBase, ControllerBase.

So, Mailers are like your controllers. As a result, you can use all the advantages of the controller without any learning curve or period. The end result is a professional looking HTML email address, ready to be sent to users of your site.

Visit the Project website for a comprehensive guide to MvcMailer. https://github.com/smsohan/MvcMailer/wiki/MvcMailer-Step-by-Step-Guide

In the guid step, you will find a way to send emails using images.

brgds. Sebastians.

+2
source

All Articles