开发者

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

开发者 https://www.devze.com 2023-04-12 06:04 出处:网络
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.

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

精彩评论

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