Advertisement
Guest User

Untitled

a guest
May 8th, 2016
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.89 KB | None | 0 0
  1.  
  2. @{
  3.  
  4. var customerName = Request["customerName"];
  5. var customerEmail = Request["customerEmail"];
  6. var customerPhone = Request["customerPhone"];
  7. var customerAdress = Request["customerAdress"];
  8. var customerEtage = Request["customerEtage"];
  9. var customerElevator = Request["customerElevator"];
  10. var customerPost = Request["customerPost"];
  11. var customerCity = Request["customerCity"];
  12. var customerType = Request["customerType"];
  13. var customerSize = Request["customerSize"];
  14. var customerDate = Request["customerDate"];
  15. var customerInfo = Request["customerInfo"];
  16. var errorMessage = "";
  17. var debuggingFlag = false;
  18. try
  19. {
  20. // Initialize WebMail helper
  21. WebMail.SmtpServer = "smtp.gmail.com";
  22. WebMail.SmtpPort = 587;
  23. WebMail.UserName = "herdorfflyt@gmail.com";
  24. WebMail.Password = "rubinherdorf";
  25. WebMail.From = "herdorfflyt@gmail.com";
  26. WebMail.EnableSsl = true;
  27.  
  28.  
  29.  
  30. // Send email
  31. WebMail.Send(to: "rasmus@nemnyk.dk",
  32. subject: "Flytning bestilt fra formular - " + customerName,
  33. body:
  34. "<h2>" + "Navn: " + customerName + "</h2>" + "<br />" +
  35. "<b>" + " - " + "Email: " + "</b>"+ customerEmail + "<br />" +
  36. "<b>" + " - " + "Telefon: " + "</b>" + customerPhone + "<br />" +
  37. "<b>" + " - " + "Adresse: " + "</b>" + customerAdress + "<br />" +
  38. "<b>" + " - " + "Etage: " + "</b>" + customerEtage + "<br />" +
  39. "<b>" + " - " + "Elevator: " + "</b>" + customerElevator + "<br />" +
  40. "<b>" + " - " + "PostNummer: " + "</b>" + customerPost + "<br />" +
  41. "<b>" + " - " + "By: " + "</b >" + customerCity + "<br />" +
  42. "<b>" + " - " + "Adresse: " + "</b>" + customerAdress + "<br />" +
  43. "<b>" + " - " + "Boligstørrelse: " + "</b>" + customerSize + "<br />" +
  44. "<b>" + " - " + "Flytningsdato: " + "</b>" + customerDate + "<br />" +
  45. "<b>" + " - " + "Andet information: " + "</b>" + customerInfo + "<br />"
  46.  
  47. );
  48. }
  49. catch (Exception ex)
  50. {
  51. errorMessage = ex.Message;
  52. }
  53.  
  54. <p class="p">Tak for din bestilling <b>@customerName</b>.</p>
  55. if (errorMessage == "")
  56. {
  57. <p class="p">
  58. Vi tjekker dagligt vores emails, og ringer dig op så snart vi har set din bestilling.
  59. </p>
  60. <p><b>@customerInfo</b></p>
  61. }
  62. else {
  63. <p class="p"><b>Deres bestilling gik <em>ikke</em> igennem.</b></p>
  64.  
  65. if (debuggingFlag)
  66. {
  67. <p>Der er styr på det shit</p>
  68. <p class="p">Hilsen Herdorf flytteforretning</p>
  69. }
  70. }
  71.  
  72. }
  73. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement