开发者

Getting view as string in asp.net mvc for email sending

I want to use Mailgun (or maybe Sendgrid) to send emails from my app.

This is pretty straightforward cause I can use RestSharp to interact with their api.

The problem lies in the fact that generating 开发者_StackOverflowan HTML email is a PITA if I cant use razor. I know there are two nuget packages (Postal, MvcMailer) that handle this problem quite nicely but they force me to use a SMTP server and I dont want or need that at all.

I just want to keep using the Mailgun API to send emails but I want to have a way to generate the markup for those emails using Razor.

How can I do this?

Please Help.


If you have a partial you can render it to a string, as in the following SO question: link

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜