Home ASP.NET MVC - How should sending email be handled?
Reply: 0

ASP.NET MVC - How should sending email be handled?

user997 Published in June 20, 2018, 10:47 pm

In an ASP.NET MVC application, how should the sending of emails be handled? I've been thinking about this, and I really like the idea of handling it in an MVC-oriented way (it is an MVC application, after all.)

What I mean is that the email that gets delivered to the user is really just a view that should have a model passed to it. This raises some questions: How should we deliver views to both the requesting browser and an SMTP server at the same time, when an action is executed? Does the framework have any facilities to support this? If not, is there some 3rd party release/guidance for this sort of functionality?

The alternatives to treating email sending in an MVC way are:

  • Email sending code shows up in the controller's action methods.
  • Email sending is a behavior of the Model objects.

How are you handling the sending of emails in your ASP.NET MVC applications? What do you think about an MVC-oriented approach?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.303875 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO