What is the best way to send a HTML email from Asp.net MVC?

后端 未结 5 1219
Happy的楠姐
Happy的楠姐 2021-01-17 23:53

I would like to be able to render a view and send it as an email, similar to what can be done with Ruby on Rails. What is the best way to do this?

EDIT: My solution

5条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-18 00:31

    Once the post mvc-preview-5-rendering-a-view-to-string-for-testing has an answer with a solution in it, that solution applies to this one as well. Once you have a string, you coud mail it using default .net mail options (as indicated by dimarzionist: SendMail / SmtpClient).

提交回复
热议问题