Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 1st, 2012  |  syntax: None  |  size: 1.16 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. .NET frameworks for formatting e-mail messages?
  2. HtmlMessage body = new HtmlMessage();
  3.   body.Header(imageLink);
  4.   body.Title("Some Text That Will Display as a Header");
  5.   body.Rows.Add("First Name", FirstName.Text);
  6.        
  7. public class HomeController : Controller {
  8.     public ActionResult Index() {
  9.         dynamic email = new Email("Example");
  10.         email.To = "webninja@example.com";
  11.         email.FunnyLink = DB.GetRandomLolcatLink();
  12.         email.Send();
  13.  
  14.         return View();
  15.     }
  16. }
  17.        
  18. To: @ViewBag.To From: lolcats@website.com Subject: Important Message
  19.  
  20. Hello, You wanted important web links right? Check out this:
  21. @ViewBag.FunnyLink
  22.  
  23. <3
  24.        
  25. ...
  26.     <b>
  27.         Your information to login is as follows:<br />
  28.         Username: $username$<br />
  29.         Password: $password$<br />
  30.     </b>
  31. ...
  32.        
  33. notificationTemplate.SetAttribute("username", Username);
  34.     notificationTemplate.SetAttribute("password", Password);
  35.        
  36. 0 = "RecipientFirstName"
  37. 1 = "ClientCompanyName"
  38. ...
  39.        
  40. 0 = "RecipientFirstName"
  41. 1 = "ClientCompanyName"
  42. ...
  43.        
  44. 0 = "RecipientFirstName"
  45. 1 = "ClientCompanyName"
  46. ...
  47.        
  48. string.Format(s, macroCodes.Select(c => EvaluateMacroCode(c, obj)).ToArray());