How to send mail with attached file without store in local server string text = System.IO.File.ReadAllText(System.IO.Path.Combine(Server.MapPath("~/Mvc/Views/SinCairForm/EmailTemplate.cshtml"))); emailBody = Razor.Parse(text, new { Message = "hello", Serial=DateTime.Now.Year.ToString(), WebURL= "http://localhost:49557" }); MailMessage mail = new MailMessage("dev@convertium.com", "kesikan@convertium.com", "Subject", emailBody); mail.IsBodyHtml = true; System.IO.MemoryStream stream = new System.IO.MemoryStream(); ...