Imports System.IO Imports Lavantech.Smtp Module SMTPExample Sub Main() Try Dim fromAddress As New EmailAddress("myname@mydomain.com", "My Name") Dim toAddress(1) As EmailAddress toAddress(0) = New EmailAddress("friend1@friend.com", "Friend 1") toAddress(1) = New EmailAddress("friend2@friend.com", "Friend 2") Dim ccAddress() As EmailAddress = {New EmailAddress("friend3@friend.com", "Friend 3")} Dim msg As New Message(fromAddress, toAddress, ccAddress, Nothing, "Test Mail", "Hello Friend...") msg.AddAttachment(New FileInfo("C:\test.zip")) SMTPMailer.SOCKET_TIMEOUT = 10000 'Sending directly without any relaying mail server. SMTPMailer.SendMail(msg) 'Using a mail server for relaying. 'SMTPMailer.SendMail(msg, "mail.myserver.com", "login", "passwd"); Catch exp As MailException Dim failedAddresses() As EmailAddress = exp.GetFailedAddresses() Dim reasons() As String = exp.GetReasons() Console.WriteLine("Mail failed for the following email id: ") Dim i As Integer For i = 0 To (failedAddresses.Length - 1) Console.WriteLine(failedAddresses(i).ToString() & " - " & reasons(i)) Next i Catch exp As Exception Console.WriteLine(exp.StackTrace) Console.WriteLine(exp.Message) End Try End Sub End Module