Page 2 of 2

Re: OAuth 2, gSuite.gmail, Mail Plugin

PostPosted: Fri May 22, 2020 8:07 am
by swingman
Yes, I see you can also create drafts and send them. The downside is that you may have to create separate code for those using Office365 and other services. The mail plugin abstracts that away. Since sending emails via Google and Office365 will soon require oAuth, it would be useful if Servoy published working examples for these two leading services. Being able to access your Facebook profile is fun, but sending email is critical for most Servoy systems.

Re: OAuth 2, gSuite.gmail, Mail Plugin

PostPosted: Sat May 23, 2020 8:14 am
by lwjwillemsen
+1 Sending email is critical in our applications.

Re: OAuth 2, gSuite.gmail, Mail Plugin

PostPosted: Sun May 24, 2020 7:54 am
by lwjwillemsen
With Google you can use an app password (allso when Basic Auth is disabled). Would that work with the Servoy SMTP send email?

Re: OAuth 2, gSuite.gmail, Mail Plugin

PostPosted: Sat May 30, 2020 1:56 am
by sbutler
I was able to get the OAuth plugin working with Office365 and send email with the standard plugin using the token. The mail properties look like this for my instance

Code: Select all
var properties = new Array()
properties.push('mail.smtp.host=smtp.office365.com')
properties.push('mail.smtp.port=587')
properties.push('mail.smtp.auth=true')
properties.push('mail.transport.protocol=smtp')
properties.push('mail.smtp.starttls.enable=true')
properties.push('mail.smtp.auth.mechanisms=XOAUTH2')
properties.push('mail.smtp.username=' + fromEmail)
properties.push('mail.smtp.password=' + accessToken)
properties.push('security.require-ssl=true')


For Google, those might change slightly. Servoy mail plugin uses standard JavaMail and there are some notes on using OAuth with JavaMail here: https://javaee.github.io/javamail/OAuth2

Re: OAuth 2, gSuite.gmail, Mail Plugin

PostPosted: Sat May 30, 2020 3:15 pm
by patrick
MailPro is also using standard java mail, so it basically works the same.

Re: OAuth 2, gSuite.gmail, Mail Plugin

PostPosted: Tue Jun 02, 2020 8:47 pm
by lwjwillemsen
goldcougar wrote:I was able to get the OAuth plugin working with Office365 and send email with the standard plugin using the token. The mail properties look like this for my instance


Which OauthProvider must I use for Office365 in the Servoy2020.03 oauth plugin?
Can you share the oauth request code for Office365?

Thanks!

Re: OAuth 2, gSuite.gmail, Mail Plugin

PostPosted: Wed Jun 03, 2020 8:42 pm
by Providence1
+1 Sending email is critical in our applications.

And:
Which OauthProvider must I use for Office365 in the Servoy2020.03 oauth plugin?
Can you share the oauth request code for Office365?

Re: OAuth 2, gSuite.gmail, Mail Plugin

PostPosted: Thu Jun 11, 2020 11:29 pm
by Providence1
Can I use the plugins.oauth.serviceBuilder authentication with multi-factor in Office 365? Has anyone been able to accomplish this yet?

Re: OAuth 2, gSuite.gmail, Mail Plugin

PostPosted: Fri Apr 23, 2021 2:01 pm
by rafig
Please can anyone following this topic look at my other post related to this
https://forum.servoy.com/viewtopic.php?f=15&t=23206
or admins move that to here if I have been 'naughty' ;-)
Thanks