Guest User

Untitled

a guest
Nov 21st, 2017
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. Imports Itenso.Rtf.Converter.Html
  2. Imports EASendMail
  3. Imports Itenso.Rtf.Support
  4. Imports Itenso.Rtf
  5.  
  6. Dim rr As String = bodytxt.Rtf.Replace("", "")
  7. Dim rtfDocument As IRtfDocument = RtfInterpreterTool.BuildDoc(rr)
  8. Dim htmlConverter As New RtfHtmlConverter(rtfDocument)
  9. Dim html1 As String = htmlConverter.Convert()
  10.  
  11. Dim oMail As New SmtpMail("TryIt")
  12. Dim oSmtp As New EASendMail.SmtpClient()
  13. oMail.From = fromtxt.Text
  14. oMail.To = New AddressCollection(totxt.Text)
  15. oMail.Subject = subjecttxt.Text
  16. oMail.HtmlBody = html1
  17. Dim oServer As New SmtpServer(MailConfig.host.Text)
  18. oServer.Port = MailConfig.port.Text
  19. oServer.ConnectType = SmtpConnectType.ConnectSSLAuto
  20. oServer.User = fromtxt.Text
  21. oServer.Password = MailConfig.password.Text
  22. Dim r As Integer
  23. If ListBox1.Items.Count <= 0 Then
  24. Else
  25. oMail.AddAttachment(ListBox1.Items(r))
  26. End If
  27. oSmtp.LogFileName = Application.StartupPath & "maillog.OFPTX"
  28.  
  29. oSmtp.SendMail(oServer, oMail)
Add Comment
Please, Sign In to add comment