Office 365 - Sending emails

Forums for specific tips, techniques and example code
Daniel
Posts: 8
Joined: Tue Sep 15, 2009 2:16 pm

Office 365 - Sending emails

Postby Daniel » Wed Dec 14, 2016 9:08 am

Hi,
We currently use the CnSmtpConnection class to send emails from Jade via a local Exchange Server.
However one of our clients is moving to Office 365, and this will mean we have to send via the Office 365 cloud.

I see that Microsoft does have a method where you can authenticate with an Office 365 mailbox and then send using SMTP client submission. This uses the server name 'smtp.office365.com', but of course requires the username/password of the hosted mailbox being used.

Has anyone done this in Jade?
Any ideas would be appreciated.

Thanks
Daniel

User avatar
ghosttie
Posts: 181
Joined: Sat Aug 15, 2009 1:25 am
Location: Atlanta, GA, USA
Contact:

Re: Office 365 - Sending emails

Postby ghosttie » Thu Dec 15, 2016 3:42 am

We ended up making a .NET helper DLL (using the System.Net.Mail.SmtpClient class) because at the time CnSmtpConnection didn't support authentication, but apparently they've added it since then, along with TLS.

Instructions for how to use them are in the documentation.
I have a catapult. Give me all the money or I will fling an enormous rock at your head.

Daniel
Posts: 8
Joined: Tue Sep 15, 2009 2:16 pm

Re: Office 365 - Sending emails

Postby Daniel » Fri Dec 16, 2016 3:25 pm

Thanks for the great reply.
We have upgraded a copy of a 6.3 jade system to 7.1.08 and updated the cardschema/karma dlls.
The CnSmtpConnection does now have the authentication and TLS option.

However when testing the sending of an email via smtp.office365.com with TLS enabled (as required in the ini file), jade fails to connect.
There is an SSL error in the jommsg log stating 'SSL_connect error in SSLv3 read server hello A' and 'SSL3_GET_RECORD:wrong version number'.
Office 365 requires TLS V1.0 or above, and SSL V3 is older and not compatible -but it seems that enabling TLS in Jade is not TLS but perhaps an older SSL version??

If I turn off TLS, then a tcp connection is established but the email is not sent (as expected since office365 requires TLS 1.x). This does seem to point to a TLS version issue?

Opions/ideas would be much appreciated.. Thanks!

JohnP
Posts: 73
Joined: Mon Sep 28, 2009 8:41 am
Location: Christchurch

Re: Office 365 - Sending emails

Postby JohnP » Fri Dec 16, 2016 5:10 pm

Don't know about CnSmtpConnection, but JADE seems to support TLS 1.1 and 1.2. From the 7.1.08 RelInfo.pdf:
Application Server OpenSSL Cipher Suite (NFS 61541)

In earlier JADE releases, only the TLSv1 protocol was supported.

JADE now supports TLS 1.1 and TLS 1.2. You can now specify the TLSv1.1 or TLSv1.2 value in the
SSLMethodName parameters in the [JadeThinClient] and [JadeAppServer] sections of the JADE initialization file.
In addition, the methodType property in the JadeSSLContext class now supports the new MethodTLSv1_1 and
MethodTLSv1_2 constants defined in the JadeSSLContext class.
So maybe it's the TLS version in CnSmtpConnection?

Daniel
Posts: 8
Joined: Tue Sep 15, 2009 2:16 pm

Re: Office 365 - Sending emails

Postby Daniel » Tue Dec 20, 2016 9:07 am

Thanks John

I checked the methodType property value in the JadeSSLContext class when it is used by CnSmtpConnection etc to send an email. It does get set to TLS 1.0

I tried 1.1 and 1.2 but it made no difference unfortunately. We'll get Jade to have a look at this :)

stevek2
Posts: 14
Joined: Fri Nov 13, 2015 5:04 pm

Re: Office 365 - Sending emails

Postby stevek2 » Mon Dec 10, 2018 1:28 pm

We are in a similar position whereby our client switched their emails to Office365 and have hit the same hurdle
(emails were working fine when using default SMTP server or relay)

We use Jade 7.1.09 and latest Cardschema required for this version of Jade and same problem in that Office365 is not processing our emails sent using cnSMTPConnection.

Has there been any response on this (from Jade) or solution that others have found?

Regards
Steve


Return to “Tips and Techniques”

Who is online

Users browsing this forum: No registered users and 15 guests