Tag: email

  • Rendering a View to a String – Email Templates in MVC4

    Hey everyone, This is just a short post showing how to render views as strings. I’ve used this as a quick way to generate email templates. The logic to render a view as a string is as follows: public static string RenderRazorViewToString(Controller controller, string viewName, string content) { controller.ViewBag.Content = content; using (var sw =…

  • Sending Emails – MVC4 on GoDaddy

    Hey everyone, Just a really basic model that can be used to send emails on GoDaddy in MVC4. The model: using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Web; using System.Net.Mail; using System.ComponentModel.DataAnnotations; namespace LL.Models { public class Email { [Key] public int EmailId { get; set; } public string From { get; set;…

Create a website or blog at WordPress.com