Function to send email to multiple users also you need to add code into web.config file
Public Sub SendEmail(ByVal emailAddress As String, ByVal Subject As String, ByVal Body As String)
Dim message As New MailMessage
Dim mf As New MailAddress("syscat@NYCT.com")
Dim emailClient As New SmtpClient
Dim a() As String = emailAddress.Split(";")
Dim i As Integer
Try
For i = 0 To a.Length - 1
If String.IsNullOrEmpty(a(i).ToString) = False Then
message.To.Add(a(i))
End If
Next
message.From = mf
message.IsBodyHtml = True
message.Subject = Subject
message.Body = Body
emailClient.UseDefaultCredentials = True
emailClient.Send(message)
Catch e As Exception
Finally
End Try
End Sub
Here is code for webconfig
<system.net>
<mailSettings>
<smtp deliveryMethod="Network" from="youeemail@domain.com">
<network host="192.168.1.1" port="25" defaultCredentials="true"/>
</smtp>
</mailSettings>
</system.net>
you may need to add user is nam password for anthetication with smtp server