This application was sending out orders without errors when smtp wasn't secured.
Now the clients webmail server was changed to ssl.
After making the changes the server times out.
I did some research and found this .ConnectType = SmtpConnectType.ConnectSSLAuto
I'm anable to assign the SmtpServer.ConnectType = SmtpConnectType.ConnectSSLAuto.
This is my code.
Dim SmtpServer As New SmtpClient()
Dim mail As New MailMessage()
SmtpServer.UseDefaultCredentials = False
SmtpServer.Credentials = New Net.NetworkCredential(jonDoe@Domain.com, srvPass)
SmtpServer.Port = 465
SmtpServer.Host = mail.Domain.com
SmtpServer.EnableSsl = true
mail = New MailMessage With {.From = New MailAddress(frome)
}
mail.To.Add(Too)
mail.Subject = Subject
mail.Body = InputBox("Enter the body here", "Body")
For Each Row In attch_tbl.Rows
OE_File = Row("OE").ToString.TrimStart("0c")
OE_File = "*" & OE_File & "*"
For Each foundFile As String In My.Computer.FileSystem.GetFiles("N:\",
Microsoft.VisualBasic.FileIO.SearchOption.SearchTopLevelOnly, OE_File)
If foundFile <> "" Then
mail.Attachments.Add(New Attachment(foundFile))
FileNum = FileNum + 1
End If
Next
Next
If FileNum >0 Then
SmtpServer.Send(mail)
end if