public ActionResult Add(Mail mail) { // TODO: Add to DB MvcApplication.Inbox.Add(mail); return new RedirectResult("/Mail"); }
public void ReceiveMail(string sender, string receiver, string subject) { try { var bodyHtml = HttpContext.Request["body-html"]; // MVC don't support hyphens in variables so we have to get the html this way var mail = new Mail { From = sender, To = receiver, Body = bodyHtml, Subject = subject }; MvcApplication.Inbox.Insert(0, mail); } catch (Exception ex) { log.Error(ex); } }
/// <summary> /// Use this method to add emails to the collection from the client. When a new item is added we will call the caller client /// function alert(message) with a message notifying the client that all went well that the email was "sent" successfully. /// </summary> /// <param name="mail"></param> public void Add(Mail mail) { MvcApplication.Inbox.Add(mail); Caller.alert("Mail sent!"); }