Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- internal static void SendEmail(MailAddress fromAddress, MailAddress toAddress, string subject, string body)
- {
- var message = new MailMessage(fromAddress, toAddress)
- {
- Subject = subject,
- Body = body
- };
- var client = new SmtpClient("smtpServerName");
- client.Send(message);
- }
- public class BaseController : Controller
- {
- protected override void OnActionExecuted(ActionExecutedContext filterContext)
- {
- // Send mail here
- base.OnActionExecuted(filterContext);
- }
- }
Add Comment
Please, Sign In to add comment