Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Html.TextBox("subject", TemplateData[0], new { @class = "form-control" })
- <div class="form-group">
- Template: <br />
- @Html.DropDownList("templateName", null, htmlAttributes: new { @class = "form-control" })
- </div>
- <div class="form-group">
- Subject:<br />
- @Html.TextBox("subject", TemplateData[0], new { @class = "form-control" })
- </div>
- <div class="form-group">
- Body:<br />
- @Html.TextArea("body", TemplateData[1], new { @class = "form-control" })
- </div>
- public ActionResult SendMail(int id, string templateName)
- {
- string[] templateData = new string[] { "" };
- if (!String.IsNullOrEmpty(templateName))
- {
- templateData = new string[] { db.Templates.Where(c => c.templateName == templateName).First().subject,
- db.Templates.Where(c => c.templateName == templateName).First().Body };
- }
- ViewBag.contactemail = db.Identifiers.Where(c => c.ID == id).First().contact;
- ViewBag.emailAddress = new SelectList(db.EmailAccounts, "emailAddress", "emailAddress");
- ViewBag.templateName = new SelectList(db.Templates, "templateName", "templateName");
- ViewBag.password = new SelectList(db.EmailAccounts, "password", "password");
- return View(templateData);
- }
Add Comment
Please, Sign In to add comment