smsohan / MvcMailer

A Mailer for ASP.Net MVC that forms the Email Body using MVC Views (Razor etc.) following Ruby on Rails ActionMailer style
MIT License
582 stars 178 forks source link

Sending email from Azure #10

Closed wiltwitt closed 13 years ago

wiltwitt commented 13 years ago

How can I use MvcMailer in Azure since Azure doesn't support smtp? I am planning to use 3rd party api to send email so is there a way to extend UserMailer.Welcome().ToHTML or .ToText to return View Result so that I can pass it to the 3rd party body method?

3rdPartyMailApi.body = UserMailer.Welcome().ToHTML

Thanks Wil

smsohan commented 13 years ago

I think you should double check if there's really no SMTP support on Azure. UserMailer.Welcome() gives you a MailMessage object. So, you could do the following, if you really need this:

3rdPartyMailApi.body = UserMailer.Welcome().Body

I would suggest, instead of doing this, just use the MailMessage object if possible, because it comes with a host of goodies, such as multi-part emails, inline images and so on.