CURLSMBS - Can't send emails when using hotmail and iCloud accounts

I’m able to send email from accounts that use the port 465 but when I have to use the port 587 I have this message in the log:



Connected to ( port 587 (#0)

TLSv1.3 (OUT), TLS handshake, Client hello (1):

220 i
error:1408F10B:SSL routines:ssl3_get_record:wrong version number

Closing connection 0

my settings are :

dim c as CURLSMBS
c.optionPort = 587
c.OptionUseSSL = c.kUseSSLall
c.OptionSSLVersion = c.kSSLVersionTLSv13

And I tried all the possibles combinations with OptionUseSSL and OptionSSLVersion and nothing works.

When I use the SMTPSecureSocket with these settings:

MailSocket.Port = 587
MailSocket.SMTPConnectionType = SMTPSecureSocket.SMTPConnectionTypes.SSLTLS
MailSocket.SSLEnabled = true

I’m able to send emails with hotmail and iCloud.

I’m surely don’t have the correct equivalent settings for CURLSMBS.

Can somebody help.


Daniel Pereira

In gmail there is a “less secure” option that will enable your account to respond to curl/ web requests. However the recommended way to access gmail is by using their secure API via oAuth2.

Chilkat has a plug-in that offers oAuth2 for Gmail and others out of the box.


@Mike Cotrone: what does the OPs problem have to do with Gmail? oAuth for Gmail is now considered super secret by Gmail, by the way, and doesn’t work anymore.

@Daniel Pereira: why do you want to use MBS when you have working code?

Your URL starts with “smtp://”?

Looks to me like you connect with TLS directly instead of first plain text and then upgrading to TLS.

You were right. I knew it was about my settings.

I was using “smtps://”

Everything works now.


1 Like