private string PopulateBody() { guestListString = new List <String>(); string body = string.Empty; using (StreamReader reader = new StreamReader(Server.MapPath("../Application Layer/EmailTemplate.html"))) { body = reader.ReadToEnd(); } eventbl = new EventBL(); eventID = Request.QueryString["eventId"]; eventbl = eventbl.GetActiveEvent(eventID); //Replace certain values in the email template with given variables body = body.Replace("{EventName}", eventbl.name); body = body.Replace("{Date}", eventbl.deadline.ToString()); body = body.Replace("{EventId}", eventID.ToString()); return(body); }