Replacing SMTPSecureSocket? MBS? Need TLS 1.3

Hi everyone,

I have a project that needs to replace SMTPSecureSocket because of the Office 365 failures and the need for TLS 1.3

Does anyone have experience or suggestions to go about doing this? The more “drop in” the better. Plugins are acceptable.

Pinging the email queen @Beatrix_Willius

Thanks for any input!

The Chilkat plugin supports TLS 1.3. See MailMan Xojo Plugin Reference Documentation . But it’s not a “drop in” solution.

On the to-do list for the next version of my app is support for Gmail and Office 365 with OAuth. The Chilkat plugin has examples. But they are a bit bare.

1 Like

Does the MBS not have it somehow through CURL ?

I converted my email application to use CURLEmailMBS and CurlSMBS when we started having issues with clients using Office 365. Took less than an hour.

I’ll try to throw together a comparison of what I had to change.

1 Like

I had been under this impression, but was hoping someone had a little more “oh here’s how,” or there’s an example, or perhaps docs I need to read.

It sounds like @Steve_Koger might have something great to share, and I eagerly await.

I’ve taken this code from my console app that is used to send a simple email message. This is not copy and paste code but should give you a comparison of how it was done with SMTPSecureSocket vs CURLEmailMBS and CURLSMBS. Obviously you must have the Monkeybread plugins to use this code. Hope this helps someone.

Old SMTPSecureSocket Connection Code:

Dim Server,UserName,Password,fromAddress,toAddress,Subject,Message as String
Dim SMTPConnect as New SMTPSecureSocket

SMTPConnect.port = Port
SMTPConnect.Secure = True
SMTPConnect.ConnectionType = SSLSocket.TLSv12
type or paste code here

New CURLEmailMBS Connection Code

Dim Server,UserName,Password,fromAddress,toAddress,Subject,Message as String
Dim SMTPConnect as New CURLEmailMBS
Dim c as New CurlSMBS
c.OptionPort = Port
c.OptionUseSSL= c.kFTPSSL_ALL

Old SMTPSecureSocket Message Creation & Sending Code:

Dim mail as New EmailMessage
  mail.subject= Subject
  mail.AddRecipient toAddress
  mail.bodyPlainText = Message

SMTPConnect.Messages.Append mail
Loop Until Sent=True

New CURLEmailMBS Message Creation and Sending Code

SMTPConnect.SetFrom fromAddress,""
  SMTPConnect.subject= Subject
  SMTPConnect.Addto toAddress,""
  SMTPConnect.PlainText = Message

if c.SetupEmail(SMTPConnect) Then
  dim er as Integer = c.Perform
  if er = 0 then
    Print "Email was sent successfully!"
    Print "Curl Server Error: "+Er.ToString+" "+c.LasterrorMessage
  end if
  Print  "Curl Client Error: "+c.Lasterror.ToString+" "+c.LasterrorMessage
End If

Really TLS 1.3?
CURL contacts server and offers 1.3, I think.

have you tried it?
What error do you see?

The OptionSSLVersion numbers from the Monkeybread Documentation:

TLSv1.0	4	TLS v1.0 or later (Added in 7.34.0)
TLSv1.1	5	TLS v1.1 or later (Added in 7.34.0)
TLSv1.2	6	TLS v1.2 or later (Added in 7.34.0)
TLSv1.3	7	TLS v1.3 or later (Added in 7.52.0)

So should support TLS v1.1 or later with the 5 that I set.

1 Like

Thank you for all the details, Steve! I will have to try this out and report back.

@Tim_Parnell were you able to get it working with the Monkeybread plugin?

It may be a few more days before I have your solution replaced into this project, but I would definitely consider your post the answer to my original question. Thank you so much for your help!

1 Like