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

Who says it's your code. Just last week, yet another find that changing a web mail setting cleared it up. In their case it was the old head to their Google account, select "Security" and scroll down to "Turn ON less secure apps".

You forgot to add the try catch block that will help you to determine the exact error you got in your applicaiton. Mostly timeout happens because of a server which is down or serving too much load.

Hope it helps you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.