4 Replies - 496 Views - Last Post: 13 September 2019 - 07:48 PM Rate Topic: -----

#1 JRCharlie   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 21-October 11

server time out while connectiong via ssl

Posted 11 September 2019 - 07:21 PM

Hi all
this is my code
Dim SmtpServer As New SmtpClient()
        Dim mail As New MailMessage()
            SmtpServer.UseDefaultCredentials = False
            SmtpServer.Credentials = New Net.NetworkCredential([email protected], 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 


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.
What am I missing.

Thanks in advanced.

Is This A Good Question/Topic? 0
  • +

Replies To: server time out while connectiong via ssl

#2 maceysoftware   User is offline

  • Member Title
  • member icon

Reputation: 383
  • View blog
  • Posts: 1,630
  • Joined: 07-September 13

Re: server time out while connectiong via ssl

Posted 12 September 2019 - 02:16 AM

This is from memory, but isn't there Connection type property on the SmtpServer Object that you need to set if its SSL something like SSLAuto or something like that? or SSLDirect? you would have to look up the meanings of the enum, if there is one.
Was This Post Helpful? 0
  • +
  • -

#3 JRCharlie   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 21-October 11

Re: server time out while connectiong via ssl

Posted 12 September 2019 - 05:52 PM

Thanks for your reply.
I did some research based on your reply and found this .ConnectType = SmtpConnectType.ConnectSSLAuto
I'm anable to assign the SmtpServer.ConnectType = SmtpConnectType.ConnectSSLAuto.
do I need to import other than System.Net.Mail
Was This Post Helpful? 0
  • +
  • -

#4 DarenR   User is offline

  • D.I.C Lover

Reputation: 634
  • View blog
  • Posts: 4,209
  • Joined: 12-January 10

Re: server time out while connectiong via ssl

Posted 13 September 2019 - 09:04 AM

it is your email port that is bad.. use port 587 instead
Was This Post Helpful? 0
  • +
  • -

#5 JRCharlie   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 21-October 11

Re: server time out while connectiong via ssl

Posted 13 September 2019 - 07:48 PM

If I use Port 587 I get the error "The remote certificate is invalid according to the validation procedure."}
Port 465 is what's used in outlook.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1