1

I'm using MvcMailer to send an email. I just specify the view's name, and it can be sent via email. But my question is, does it have any constraint with the view's name? I mean, for example, I want to send the Index view in the Home controller, what should I do?

This tutorial works well for me, but I don't understand how it works, so I can't apply it. Could you help me?

Triet Doan
  • 11,455
  • 8
  • 36
  • 69
  • Please be more specific. Do you want to send the mail view `Index` by calling the mail function in your application's `HomeController`? Note that the mailer uses own views, located in `Views\UserMailer` when you followed that tutorial. – Marthijn May 08 '13 at 09:46

1 Answers1

0

You can override the base class virtual property "MailerName" by returning the desirable view location name.

MvcMailer has a MailerName property which is virtual in base class. and MvcMailer class uses this property for finding the view in the location available to this property. So overriding this property with desirable location will make mvc framework to find the view in the given location.