3

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 an 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.

1

1 Answer 1

5

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.