Hello; This seems to rather be VBScript and not VB.Net - which do you require help with? VB.Net:
Public Shared Sub SendMail(ByVal mailTo As MailAddressCollection, ByVal mailFrom As String, _
ByVal mailSubject As String, ByVal mailPriority As System.Net.Mail.MailPriority, _
ByVal isHtmlFormat As Boolean, ByVal mailBody As String, _
Optional ByVal mailCC As MailAddressCollection = Nothing, _
Optional ByVal mailBcc As MailAddressCollection = Nothing, _
Optional ByVal mailFromDisplayName As String = Nothing)
Dim msg As New System.Net.Mail.MailMessage
For Each m As MailAddress In mailTo
msg.To.Add(m)
Next
If mailFromDisplayName Is Nothing Then
msg.From = New MailAddress(mailFrom)
Else
msg.From = New MailAddress(mailFrom, mailFromDisplayName)
End If
msg.Subject = mailSubject
msg.Priority = mailPriority
msg.IsBodyHtml = isHtmlFormat
If Not mailCC Is Nothing Then
For Each m As MailAddress In mailCC
msg.CC.Add(m)
Next
End If
If Not mailBcc Is Nothing Then
For Each m As MailAddress In mailBcc
msg.Bcc.Add(m)
Next
End If
msg.Body = mailBody
Dim smtpServer As New System.Net.Mail.SmtpClient()
smtpServer.Port = 25
smtpServer.Host = Convert.ToString(ConfigurationManager.AppSettings("SiteSMTP"))
Try
smtpServer.Send(msg)
Catch ex As Exception
Throw New Exception(String.Format("An error occurred sending an e-mail. The error recorded was {0}", ex))
End Try
End Sub