I need to render a view to send as an email using Asp.Net MVC 2.
Using the new Html.Partial method it is easy to render a view to a string and then send it as an email as long as you do it from inside a controller or a view (where you can access the html helper or the controller context)
I need to be able to send a delayed email using a background service. I want to render them in the same way as I would in a controller but I can't access the Html Helper or the controller context.
I tried to make my own method using the ViewPage class and calling its render method myslef passing in a stringwriter. Problem is that I don't have a view context for the html helper, so I can only render views that don't use the html helper or the url helper.
Any Ideas.
Thanks