I have an ActionResult in my controller that I want to send an HTML email from, the body of that email is generated by a view. Rather than having 2 actionresults methods in my controller can I just get the result of the view when passed my model and avoid it being sent to the browser?
Share
MvcMailer is a brilliant little project that supports generating emails using MVC views. It is available as a NuGet package.
In order to render a view to a string instead of response use this code (
relativePathpoints to your view file):