Does anyone know how to pass a XOAUTH2 token with NetTalk 10 for sending email?
I am trying to set up the following: Authenticate an IMAP, POP or SMTP connection using OAuth | Microsoft Learn
And already got the token, but can’t figure out how to send it with NetTalk 10 NetSendMail class
Bruce
October 4, 2024, 4:12am
2
Theres a token property in the EmailParameters group, but from memory I’d say it was introduced sometime after NetTalk 10.
We just did the upgrade to NetTalk 14 as I saw that in the documentation: NetTalk Email
BUT, it seems it’s not XOAUTH2 - it stil sends a AUTH LOGIN (using a tool to check what it sends called SMTP4DEV: GitHub - rnwood/smtp4dev: smtp4dev - the fake smtp email server for development and testing ) instead of AUTH XOAUTH which is required by microsoft: Authenticate an IMAP, POP or SMTP connection using OAuth | Microsoft Learn
NetTalk 14 definitely can do AUTH XOAUTH2. You can investigate NetEmailSend class source code (NetEmail.clw) to find out the conditions. AuthUser and AuthToken class properties must be set.
First off - where can you find the class-source?
Secondly, already got it working late last friday - I was putting it in Token
and not AuthToken
(as the docs kept mentioning Token
and not AuthToken
under your Clarion folder:
\accessory\libsrc\win\net*.clw
and same for the inc files