Advertisement
Guest User

Untitled

a guest
Jul 10th, 2017
568
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.28 KB | None | 0 0
  1. #Region "EMailHandlers"
  2.  
  3. '=============================================================================================================
  4. ' EMail Claims Pack to customer
  5. '=============================================================================================================
  6. Protected Sub BTNSendPack_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BTNSendPack.Click
  7.  
  8. '=== Check the files have already been created for this ClaimID
  9. If File.Exists(Server.MapPath("UploadedFiles\") & TBClaimRef.Text & "\ClaimPack.doc") Then
  10.  
  11. '=== Get the Customers details for this ClaimID
  12. Dim Claim As ClaimsDB = New ClaimsDB
  13. Dim CustomerDetails As CustomerDetails
  14. Dim ClaimDetails As ClaimDetails
  15.  
  16. Dim ToAddress As String = ""
  17.  
  18. If TBClaimRef.Text <> "" Then
  19.  
  20. CustomerDetails = Claim.GetCustomerDetails(TBClaimRef.Text)
  21. ClaimDetails = Claim.GetDetails(TBClaimRef.Text)
  22. ToAddress = CustomerDetails.EMailAddress
  23.  
  24. End If
  25.  
  26. '=== Check we have an e-mail address
  27. If ToAddress = "" Then
  28.  
  29. LBLMessage.Text = "You cannot email the claims pack as no e-mail address is stored for the customer."
  30. Exit Sub
  31.  
  32. End If
  33.  
  34. '=== Create the email
  35. Dim FromAddress As String = "info@totalcareltd.com"
  36. Dim Subject As String = "Important Information From TOTAL CARE"
  37. Dim Body As String = "Dear " & CustomerDetails.Title & " " & CustomerDetails.Surname & " " & CustomerDetails.OtherTitle & " " & CustomerDetails.OtherSurname & "<br /><br />"
  38.  
  39. If ClaimDetails.ClaimTypeID = 6 Then
  40.  
  41. Body &= "Thank you for contacting Total Care to reclaim your mis-sold Payment Protection Insurance.<br /><br />"
  42. Body &= "Please find attached your introduction letter, form of authority, questionnaire and Terms and Conditions of Business.<br />"
  43. Body &= "To enable us to proceed with your claim please download, print and complete the form of authority and questionnaire and return to us.<br /><br />"
  44. Body &= "If you don’t have the facility to download and/or print the pack, please do not hesitate to reply to this e mail and we will post a pack to you.<br /><br />"
  45. Body &= "If you have any questions, please do not hesitate to reply to this mail or call us on 03301 11 33 77.<br /><br />"
  46. Body &= "We look forward to reclaiming your mis-sold Payment Protection Insurance for you.<br /><br />"
  47. Body &= "Kind Regards<br /><br />"
  48. Body &= "Total Care<br /><br />"
  49. Body &= "Total Care Compensation Specialists Limited<br />"
  50. Body &= "119a Bury Old Road, Whitefield, Manchester, M45 7AY<br /><br />"
  51. Body &= "PS. Please remember, we can also claim back unfair charges raised on credit cards, loans and mortgages!!"
  52.  
  53. ElseIf ClaimDetails.ClaimTypeID = 9 Then
  54.  
  55. Body &= "Thank you for contacting Total Care to assess your credit agreement.<br /><br />"
  56. Body &= "Please find attached your introduction letter, form of authority and our Terms and Conditions of business.<br />"
  57. Body &= "To enable us to assess your agreement to see if it can be classed as ‘unenforceable’, please download, print, complete the form of authority and send it back to us.<br /><br />"
  58. Body &= "If you don’t have the facility to download and/or print the pack, please do not hesitate to reply to this e mail and we will post a pack to you.<br /><br />"
  59. Body &= "If you have any questions, please do not hesitate to reply to this mail or call us on 03301 11 33 77.<br /><br />"
  60. Body &= "We look forward to receiving your signed Form of Authority to start your claim!<br /><br />"
  61. Body &= "Kind Regards<br /><br />"
  62. Body &= "Total Care<br /><br />"
  63. Body &= "Total Care Compensation Specialists Limited<br />"
  64. Body &= "119a Bury Old Road, Whitefield, Manchester, M45 7AY<br /><br />"
  65. Body &= "PS. Please remember, we can also claim back unfair charges raised on credit cards, loans and mortgages!!"
  66.  
  67. ElseIf ClaimDetails.ClaimTypeID = 11 Then
  68.  
  69. Body &= "Thank you for contacting Total Care to assess your mortgage agreement.<br /><br />"
  70. Body &= "Please find attached your introduction letter, form of authority and our Terms and Conditions of business.<br />"
  71. Body &= "To enable us to assess your agreement to see if it can be classed as ‘unenforceable’, please download, print, complete the form of authority and send it back to us with the application fee.<br /><br />"
  72.  
  73. Body &= "If you don’t have the facility to download and/or print the pack, please do not hesitate to reply to this e mail and we will post a pack to you.<br /><br />"
  74. Body &= "If you have any questions, please do not hesitate to reply to this mail or call us on 03301 11 33 77.<br /><br />"
  75. Body &= "We look forward to receiving your signed Form of Authority to start your claim!<br /><br />"
  76. Body &= "Kind Regards<br /><br />"
  77. Body &= "Total Care<br /><br />"
  78. Body &= "Total Care Compensation Specialists Limited<br />"
  79. Body &= "119a Bury Old Road, Whitefield, Manchester, M45 7AY<br /><br />"
  80. Body &= "PS. Please remember, we can also claim back unfair charges raised on credit cards, loans and mortgages!!"
  81.  
  82. Else
  83.  
  84. Body &= "Thank you for contacting Total Care to reclaim your unfair finance charges.<br /><br />"
  85. Body &= "Please find attached your introduction letter, forms of authority and our Terms and Conditions of business.<br />"
  86. Body &= "To enable us to proceed with your claim please download, print and complete the form of authority and send it back to us.<br /><br />"
  87. Body &= "If you don’t have the facility to download and/or print the pack, please do not hesitate to reply to this e mail and we will post a pack to you.<br /><br />"
  88. Body &= "If you have any questions, please do not hesitate to reply to this mail or call us on 03301 11 33 77.<br /><br />"
  89. Body &= "We look forward to reclaiming your charges for you!<br /><br />"
  90. Body &= "Kind Regards<br /><br />"
  91. Body &= "Total Care<br /><br />"
  92. Body &= "Total Care Compensation Specialists Limited<br />"
  93. Body &= "119a Bury Old Road, Whitefield, Manchester, M45 7AY<br /><br />"
  94. Body &= "PS. Please remember, we can also claim back unfair charges raised on credit cards, loans and mortgages!!"
  95.  
  96. End If
  97.  
  98.  
  99. Dim EMail As New MailMessage(FromAddress, ToAddress, Subject, Body)
  100. EMail.IsBodyHtml = True
  101.  
  102. '=== add attachments to email
  103. 'EMail.Attachments.Add(New Attachment(Server.MapPath("UploadedFiles\") & TBClaimRef.Text & "\TermsOfBusiness.pdf"))
  104. EMail.Attachments.Add(New Attachment(Server.MapPath("UploadedFiles\") & TBClaimRef.Text & "\ClaimPack.doc"))
  105.  
  106. '=== Send the email (smtp server details held in system.net section of web config)
  107. Try
  108. Dim Smtp As New SmtpClient
  109. Smtp.Send(EMail)
  110.  
  111. '=== Notify User
  112. LBLMessage.Text = "Sucessfully sent claims pack e-mail."
  113.  
  114.  
  115. Catch ex As SmtpFailedRecipientException
  116.  
  117. LBLMessage.Text = "Failed to send claims pack e-mail (smtp recipients exception): "
  118. LBLMessage.Text &= ex.StatusCode.ToString
  119.  
  120. Catch ex As SmtpException
  121.  
  122. LBLMessage.Text = "Failed to send claims pack e-mail (smtp exception): "
  123. LBLMessage.Text &= ex.StatusCode.ToString & " : "
  124. LBLMessage.Text &= ex.InnerException.Message.ToString
  125.  
  126. Catch ex As Exception
  127.  
  128. LBLMessage.Text = "Failed to send claims pack e-mail (general exception): "
  129. LBLMessage.Text &= (ex.Message.ToString & "<br />")
  130.  
  131. End Try
  132.  
  133. Else
  134. LBLMessage.Text = "Please create the claims pack documents before trying to e-mail them."
  135. End If
  136.  
  137. End Sub
  138.  
  139. Protected Sub BTNSend_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BTNSend.Click
  140. '=== Get the Customers details for this ClaimID
  141. Dim Claim As ClaimsDB = New ClaimsDB
  142. Dim ClaimDetails As ClaimDetails
  143. Dim CustomerDetails As CustomerDetails
  144. Dim ToAddress As String = ""
  145.  
  146. If TBClaimRef.Text <> "" Then
  147.  
  148. CustomerDetails = Claim.GetCustomerDetails(TBClaimRef.Text)
  149. ClaimDetails = Claim.GetDetails(TBClaimRef.Text)
  150. ToAddress = CustomerDetails.EMailAddress
  151.  
  152. End If
  153.  
  154. '=== Check we have an e-mail address
  155. If ToAddress = "" Then
  156.  
  157. LBLMessage.Text = "You cannot email an update as no e-mail address is stored for the customer."
  158. Exit Sub
  159.  
  160. End If
  161.  
  162. '=== Create the email
  163. Dim FromAddress As String = "info@totalcareltd.com"
  164. Dim Subject As String = "Important Information From TOTAL CARE"
  165. Dim Body As String = "Dear " & CustomerDetails.Title & " " & CustomerDetails.Surname & " " & CustomerDetails.OtherTitle & " " & CustomerDetails.OtherSurname & "<br /><br />"
  166.  
  167. If DDLClaimTypeID.SelectedValue = 9 Then
  168.  
  169. Body &= "Thank you for contacting Total Care to assess your credit agreement to see if it is fair.<br />"
  170. Body &= "We are pleased to confirm that your copy credit agreement has arrived from " & Claim.GetBankName(ClaimDetails.BankID) & " today.<br /><br />"
  171. Body &= "These have been passed to our vetting team.<br /><br />"
  172. Body &= "They will carefully check the documents and advise you within the next 28 days what we can do for you next.<br /><br />"
  173. Body &= "If you have any further questions, please do not hesitate to call us on 03301 11 33 77 or click reply to this e mail.<br /><br />"
  174. Body &= "Kind Regards<br /><br />"
  175. Body &= "Total Care<br /><br />"
  176. Body &= "Total Care Compensation Specialists Limited<br />"
  177. Body &= "119a Bury Old Road, Whitefield, Manchester, M45 7AY<br /><br />"
  178. Body &= "PS. Remember, we can also help you manage your finances if you are struggling. Speak to one of our helpful advisors today!<br />"
  179.  
  180. End If
  181.  
  182.  
  183. Dim EMail As New MailMessage(FromAddress, ToAddress, Subject, Body)
  184. EMail.IsBodyHtml = True
  185.  
  186. '=== Send the email (smtp server details held in system.net section of web config)
  187. Try
  188. Dim Smtp As New SmtpClient
  189. Smtp.Send(EMail)
  190.  
  191. '=== Notify User
  192. LBLMessage.Text = "Sucessfully sent e-mail."
  193.  
  194.  
  195. Catch ex As SmtpFailedRecipientException
  196.  
  197. LBLMessage.Text = "Failed to send e-mail (smtp recipients exception): "
  198. LBLMessage.Text &= ex.StatusCode.ToString
  199.  
  200. Catch ex As SmtpException
  201.  
  202. LBLMessage.Text = "Failed to send e-mail (smtp exception): "
  203. LBLMessage.Text &= ex.StatusCode.ToString & " : "
  204. LBLMessage.Text &= ex.InnerException.Message.ToString
  205.  
  206. Catch ex As Exception
  207.  
  208. LBLMessage.Text = "Failed to send e-mail (general exception): "
  209. LBLMessage.Text &= (ex.Message.ToString & "<br />")
  210.  
  211. End Try
  212. End Sub
  213.  
  214. Protected Sub BTNSendDefLetSentLender_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BTNSendDefLetSentLender.Click
  215. '=== Get the Customers details for this ClaimID
  216. Dim Claim As ClaimsDB = New ClaimsDB
  217. Dim ClaimDetails As ClaimDetails
  218. Dim CustomerDetails As CustomerDetails
  219. Dim ToAddress As String = ""
  220.  
  221. If TBClaimRef.Text <> "" Then
  222.  
  223. CustomerDetails = Claim.GetCustomerDetails(TBClaimRef.Text)
  224. ClaimDetails = Claim.GetDetails(TBClaimRef.Text)
  225. ToAddress = CustomerDetails.EMailAddress
  226.  
  227. End If
  228.  
  229. '=== Check we have an e-mail address
  230. If ToAddress = "" Then
  231.  
  232. LBLMessage.Text = "You cannot email an update as no e-mail address is stored for the customer."
  233. Exit Sub
  234.  
  235. End If
  236.  
  237. '=== Create the email
  238. Dim FromAddress As String = "info@totalcareltd.com"
  239. Dim Subject As String = "Important Information From TOTAL CARE"
  240. Dim Body As String = "Dear " & CustomerDetails.Title & " " & CustomerDetails.Surname & " " & CustomerDetails.OtherTitle & " " & CustomerDetails.OtherSurname & "<br /><br />"
  241.  
  242. If DDLClaimTypeID.SelectedValue = 9 Then
  243.  
  244. Body &= "Thank you for contacting Total Care to assess your credit agreement to see if it is fair.<br />"
  245. Body &= "Unfortunately, we have not received a response from your Lender within the legal timeframe of four weeks.<br /><br />"
  246. Body &= "We have therefore sent a ‘Default Notice’ to your Lender.<br />"
  247. Body &= "This gives them 14 days to provide a copy of your credit agreement.<br /><br />"
  248. Body &= "We have diaried your claim for 21 days from today. This gives the Lender time for our Default Notice to arrive, for them to prepare a response and for it to be posted back to us.<br /><br />"
  249. Body &= "Once the 21 days has expired, if we have not received the copy of your credit agreement from your Lender, we will contact you again to explain what happens next.<br /><br />"
  250. Body &= "If you have any further questions, please do not hesitate to call us on 03301 11 33 77 or click reply to this e mail.<br /><br />"
  251. Body &= "Kind Regards<br /><br />"
  252. Body &= "Total Care<br /><br />"
  253. Body &= "Total Care Compensation Specialists Limited<br />"
  254. Body &= "119a Bury Old Road, Whitefield, Manchester, M45 7AY<br /><br />"
  255. Body &= "PS. Remember, we can also help you manage your finances if you are struggling. Speak to one of our helpful advisors today!<br />"
  256.  
  257. End If
  258.  
  259.  
  260. Dim EMail As New MailMessage(FromAddress, ToAddress, Subject, Body)
  261. EMail.IsBodyHtml = True
  262.  
  263. '=== Send the email (smtp server details held in system.net section of web config)
  264. Try
  265. Dim Smtp As New SmtpClient
  266. Smtp.Send(EMail)
  267.  
  268. '=== Notify User
  269. LBLMessage.Text = "Sucessfully sent e-mail."
  270.  
  271.  
  272. Catch ex As SmtpFailedRecipientException
  273.  
  274. LBLMessage.Text = "Failed to send e-mail (smtp recipients exception): "
  275. LBLMessage.Text &= ex.StatusCode.ToString
  276.  
  277. Catch ex As SmtpException
  278.  
  279. LBLMessage.Text = "Failed to send e-mail (smtp exception): "
  280. LBLMessage.Text &= ex.StatusCode.ToString & " : "
  281. LBLMessage.Text &= ex.InnerException.Message.ToString
  282.  
  283. Catch ex As Exception
  284.  
  285. LBLMessage.Text = "Failed to send e-mail (general exception): "
  286. LBLMessage.Text &= (ex.Message.ToString & "<br />")
  287.  
  288. End Try
  289. End Sub
  290.  
  291. Protected Sub BTNSendFOARecd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BTNSendFOARecd.Click
  292.  
  293. '=== Get the Customers details for this ClaimID
  294. Dim Claim As ClaimsDB = New ClaimsDB
  295. Dim ClaimDetails As ClaimDetails
  296. Dim CustomerDetails As CustomerDetails
  297. Dim ToAddress As String = ""
  298.  
  299. If TBClaimRef.Text <> "" Then
  300.  
  301. CustomerDetails = Claim.GetCustomerDetails(TBClaimRef.Text)
  302. ClaimDetails = Claim.GetDetails(TBClaimRef.Text)
  303. ToAddress = CustomerDetails.EMailAddress
  304.  
  305. End If
  306.  
  307. '=== Check we have an e-mail address
  308. If ToAddress = "" Then
  309.  
  310. LBLMessage.Text = "You cannot email an update as no e-mail address is stored for the customer."
  311. Exit Sub
  312.  
  313. End If
  314.  
  315. '=== Create the email
  316. Dim FromAddress As String = "info@totalcareltd.com"
  317. Dim Subject As String = "Important Information From TOTAL CARE"
  318. Dim Body As String = "Dear " & CustomerDetails.Title & " " & CustomerDetails.Surname & " " & CustomerDetails.OtherTitle & " " & CustomerDetails.OtherSurname & "<br /><br />"
  319.  
  320. If DDLClaimTypeID.SelectedValue = 3 Or DDLClaimTypeID.SelectedValue = 4 Or DDLClaimTypeID.SelectedValue = 5 Then
  321.  
  322. Body &= "Thank you for contacting Total Care to reclaim your unfair charges.<br />"
  323. Body &= "We are pleased to confirm that your signed Form of Authority has arrived.<br /><br />"
  324. Body &= "This has been processed to " & Claim.GetBankName(ClaimDetails.BankID) & " today.<br /><br />"
  325. Body &= "By Law they have up to eight weeks to produce and send copy statements to us.<br />"
  326. Body &= "In some circumstances they will send the copy statements to you. If this happens, please call us to tell us.<br />"
  327. Body &= "As soon as we have received the copy statements we will contact you with an update again.<br />"
  328. Body &= "If you have any further questions, please do not hesitate to call us on 03301 11 33 77 or click reply to this e mail.<br /><br />"
  329. Body &= "Kind Regards<br /><br />"
  330. Body &= "Total Care<br /><br />"
  331. Body &= "Total Care Compensation Specialists Limited<br />"
  332. Body &= "119a Bury Old Road, Whitefield, Manchester, M45 7AY<br /><br />"
  333. Body &= "PS. Remember, we can also help you manage your finances if you are struggling. Speak to one of our helpful advisors today!<br />"
  334.  
  335. ElseIf DDLClaimTypeID.SelectedValue = 6 Then
  336.  
  337. Body &= "Thank you for contacting Total Care to reclaim your ‘mis-sold’ payment protection insurance.<br />"
  338. Body &= "We are pleased to confirm that your signed Form of Authority and questionnaire has arrived.<br /><br />"
  339. Body &= "This has been processed to " & Claim.GetBankName(ClaimDetails.BankID) & " today.<br /><br />"
  340. Body &= "By Law they have up to eight weeks to respond to the complaint.<br />"
  341. Body &= "In some circumstances they will write directly to you. If this happens, please call us to tell us.<br />"
  342. Body &= "As soon as we have received communication from them, or the eight week time limit has expired, we will contact you with an update again.<br />"
  343. Body &= "If you have any further questions, please do not hesitate to call us on 03301 11 33 77 or click reply to this e mail.<br /><br />"
  344. Body &= "Kind Regards<br /><br />"
  345. Body &= "Total Care<br /><br />"
  346. Body &= "Total Care Compensation Specialists Limited<br />"
  347. Body &= "119a Bury Old Road, Whitefield, Manchester, M45 7AY<br /><br />"
  348. Body &= "PS. Remember, we can also help you manage your finances if you are struggling. Speak to one of our helpful advisors today!<br />"
  349.  
  350. ElseIf DDLClaimTypeID.SelectedValue = 9 Then
  351.  
  352. Body &= "Thank you for contacting Total Care to assess your credit agreement to see if it is fair.<br />"
  353. Body &= "We are pleased to confirm that your signed Form of Authority has arrived.<br /><br />"
  354. Body &= "This has been processed to " & Claim.GetBankName(ClaimDetails.BankID) & " today.<br /><br />"
  355. Body &= "By Law they have up to four weeks to produce and send a copy of your credit agreement to us.<br />"
  356. Body &= "In some circumstances they will write directly to you. If this happens, please call us to tell us.<br />"
  357. Body &= "As soon as we have received the copy agreement or the four weeks time limit has elapsed, we will contact you with an update again.<br />"
  358. Body &= "If you have any further questions, please do not hesitate to call us on 03301 11 33 77 or click reply to this e mail.<br /><br />"
  359. Body &= "Kind Regards<br /><br />"
  360. Body &= "Total Care<br /><br />"
  361. Body &= "Total Care Compensation Specialists Limited<br />"
  362. Body &= "119a Bury Old Road, Whitefield, Manchester, M45 7AY<br /><br />"
  363. Body &= "PS. Remember, we can also help you manage your finances if you are struggling. Speak to one of our helpful advisors today!<br />"
  364.  
  365. End If
  366.  
  367.  
  368. Dim EMail As New MailMessage(FromAddress, ToAddress, Subject, Body)
  369. EMail.IsBodyHtml = True
  370.  
  371. '=== Send the email (smtp server details held in system.net section of web config)
  372. Try
  373. Dim Smtp As New SmtpClient
  374. Smtp.Send(EMail)
  375.  
  376. '=== Notify User
  377. LBLMessage.Text = "Sucessfully sent e-mail."
  378.  
  379.  
  380. Catch ex As SmtpFailedRecipientException
  381.  
  382. LBLMessage.Text = "Failed to send e-mail (smtp recipients exception): "
  383. LBLMessage.Text &= ex.StatusCode.ToString
  384.  
  385. Catch ex As SmtpException
  386.  
  387. LBLMessage.Text = "Failed to send e-mail (smtp exception): "
  388. LBLMessage.Text &= ex.StatusCode.ToString & " : "
  389. LBLMessage.Text &= ex.InnerException.Message.ToString
  390.  
  391. Catch ex As Exception
  392.  
  393. LBLMessage.Text = "Failed to send e-mail (general exception): "
  394. LBLMessage.Text &= (ex.Message.ToString & "<br />")
  395.  
  396. End Try
  397.  
  398. End Sub
  399.  
  400. Protected Sub BTNSendStatementsRecdLender_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BTNSendStatementsRecdLender.Click
  401.  
  402. End Sub
  403.  
  404. Protected Sub BTNPackReceivedEmailUpdate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BTNPackReceivedEmailUpdate.Click
  405.  
  406. '=== Get the Customers details for this ClaimID
  407. Dim Claim As ClaimsDB = New ClaimsDB
  408. Dim ClaimDetails As ClaimDetails
  409. Dim CustomerDetails As CustomerDetails
  410. Dim ToAddress As String = ""
  411.  
  412. If TBClaimRef.Text <> "" Then
  413.  
  414. CustomerDetails = Claim.GetCustomerDetails(TBClaimRef.Text)
  415. ClaimDetails = Claim.GetDetails(TBClaimRef.Text)
  416. ToAddress = CustomerDetails.EMailAddress
  417.  
  418. End If
  419.  
  420. '=== Check we have an e-mail address
  421. If ToAddress = "" Then
  422.  
  423. LBLMessage.Text = "You cannot email an update as no e-mail address is stored for the customer."
  424. Exit Sub
  425.  
  426. End If
  427.  
  428. '=== Create the email
  429. Dim FromAddress As String = "info@totalcareltd.com"
  430. Dim Subject As String = "Important Information From TOTAL CARE"
  431. Dim Body As String = "Dear " & CustomerDetails.Title & " " & CustomerDetails.Surname & " " & CustomerDetails.OtherTitle & " " & CustomerDetails.OtherSurname & "<br /><br />"
  432.  
  433. If ClaimDetails.ClaimTypeID = 11 Then
  434. Body &= "<b>AN UPDATE ON YOUR MISSOLD MORTGAGE CLAIM</b><br /><br />"
  435. Body &= "Thank you for contacting Total Care.<br /><br />"
  436. Body &= "We are pleased to confirm we have received your signed Form of Authority and application fee.<br /><br />"
  437. Body &= "We have processed this to your Lender today.<br /><br />"
  438. Body &= "By Law, your Lender has eight weeks to produce the necessary documents we require and send them to us.<br /><br />"
  439. Body &= "<b>Please remember-if your Lender sends any documents to you, or any correspondence regarding the claim, please ensure this is forwarded to us as soon as it is received.</b><br /><br />"
  440. Body &= "Once we have received your documents we will contact you again to confirm what will happen next.<br /><br />"
  441. Body &= "If you have any further questions, please do not hesitate to call us on 03301 11 33 77 or click reply to this e mail.<br /><br />"
  442. Body &= "Kind Regards<br /><br />"
  443. Body &= "Total Care<br /><br />"
  444. Body &= "Total Care Compensation Specialists Limited<br />"
  445. Body &= "119a Bury Old Road, Whitefield, Manchester, M45 7AY<br /><br />"
  446. Else
  447. Body &= "<b>AN UPDATE ON YOUR CLAIM</b><br /><br />"
  448. Body &= "Thank you for contacting Total Care.<br /><br />"
  449. Body &= "We are pleased to confirm we have received your signed Form of Authority.<br /><br />"
  450. Body &= "We have processed this to your Lender today.<br /><br />"
  451. Body &= "By Law, your Lender has eight weeks to produce the necessary documents we require and send them to us.<br /><br />"
  452. Body &= "<b>Please remember-if your Lender sends any documents to you, or any correspondence regarding the claim, please ensure this is forwarded to us as soon as it is received.</b><br /><br />"
  453. Body &= "Once we have received your documents we will contact you again to confirm what will happen next.<br /><br />"
  454. Body &= "If you have any further questions, please do not hesitate to call us on 03301 11 33 77 or click reply to this e mail.<br /><br />"
  455. Body &= "Kind Regards<br /><br />"
  456. Body &= "Total Care<br /><br />"
  457. Body &= "Total Care Compensation Specialists Limited<br />"
  458. Body &= "119a Bury Old Road, Whitefield, Manchester, M45 7AY<br /><br />"
  459. End If
  460.  
  461. Dim EMail As New MailMessage(FromAddress, ToAddress, Subject, Body)
  462. EMail.IsBodyHtml = True
  463.  
  464. '=== Send the email (smtp server details held in system.net section of web config)
  465. Try
  466. Dim Smtp As New SmtpClient
  467. Smtp.Send(EMail)
  468.  
  469. '=== Notify User
  470. LBLMessage.Text = "Sucessfully sent e-mail."
  471.  
  472.  
  473. Catch ex As SmtpFailedRecipientException
  474.  
  475. LBLMessage.Text = "Failed to send e-mail (smtp recipients exception): "
  476. LBLMessage.Text &= ex.StatusCode.ToString
  477.  
  478. Catch ex As SmtpException
  479.  
  480. LBLMessage.Text = "Failed to send e-mail (smtp exception): "
  481. LBLMessage.Text &= ex.StatusCode.ToString & " : "
  482. LBLMessage.Text &= ex.InnerException.Message.ToString
  483.  
  484. Catch ex As Exception
  485.  
  486. LBLMessage.Text = "Failed to send e-mail (general exception): "
  487. LBLMessage.Text &= (ex.Message.ToString & "<br />")
  488.  
  489. End Try
  490.  
  491. End Sub
  492.  
  493. Protected Sub BTNStatementReceivedEmailUpdate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BTNStatementReceivedEmailUpdate.Click
  494.  
  495. '=== Get the Customers details for this ClaimID
  496. Dim Claim As ClaimsDB = New ClaimsDB
  497. Dim CustomerDetails As CustomerDetails
  498. Dim ToAddress As String = ""
  499.  
  500. If TBClaimRef.Text <> "" Then
  501.  
  502. CustomerDetails = Claim.GetCustomerDetails(TBClaimRef.Text)
  503. ToAddress = CustomerDetails.EMailAddress
  504.  
  505. End If
  506.  
  507. '=== Check we have an e-mail address
  508. If ToAddress = "" Then
  509.  
  510. LBLMessage.Text = "You cannot email an update as no e-mail address is stored for the customer."
  511. Exit Sub
  512.  
  513. End If
  514.  
  515. '=== Create the email
  516. Dim FromAddress As String = "info@totalcareltd.com"
  517. Dim Subject As String = "Important Information From TOTAL CARE"
  518. Dim Body As String = "Dear " & CustomerDetails.Title & " " & CustomerDetails.Surname & " " & CustomerDetails.OtherTitle & " " & CustomerDetails.OtherSurname & "<br /><br />"
  519. Body &= "<b>AN UPDATE ON YOUR CLAIM</b><br /><br />"
  520. Body &= "We are pleased to confirm the necessary documents have arrived from your Lender.<br /><br />"
  521. Body &= "These have been passed to our processing team who will write to you/e mail you within the next 28 days to advise the next steps.<br /><br />"
  522. Body &= "In the meantime, if you require any further information, do not hesitate to click reply to this e mail or call 03301 11 33 77.<br /><br />"
  523. Body &= "Kind Regards<br /><br />"
  524. Body &= "Total Care<br /><br />"
  525. Body &= "Total Care Compensation Specialists Limited<br />"
  526. Body &= "119a Bury Old Road, Whitefield, Manchester, M45 7AY<br /><br />"
  527.  
  528. Dim EMail As New MailMessage(FromAddress, ToAddress, Subject, Body)
  529. EMail.IsBodyHtml = True
  530.  
  531. '=== Send the email (smtp server details held in system.net section of web config)
  532. Try
  533. Dim Smtp As New SmtpClient
  534. Smtp.Send(EMail)
  535.  
  536. '=== Notify User
  537. LBLMessage.Text = "Sucessfully sent e-mail."
  538.  
  539.  
  540. Catch ex As SmtpFailedRecipientException
  541.  
  542. LBLMessage.Text = "Failed to send e-mail (smtp recipients exception): "
  543. LBLMessage.Text &= ex.StatusCode.ToString
  544.  
  545. Catch ex As SmtpException
  546.  
  547. LBLMessage.Text = "Failed to send e-mail (smtp exception): "
  548. LBLMessage.Text &= ex.StatusCode.ToString & " : "
  549. LBLMessage.Text &= ex.InnerException.Message.ToString
  550.  
  551. Catch ex As Exception
  552.  
  553. LBLMessage.Text = "Failed to pack e-mail (general exception): "
  554. LBLMessage.Text &= (ex.Message.ToString & "<br />")
  555.  
  556. End Try
  557.  
  558. End Sub
  559.  
  560. #End Region
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement