OAuth 2, gSuite.gmail, Mail Plugin

Questions and answers on developing, deploying and using plugins and JavaBeans

Re: OAuth 2, gSuite.gmail, Mail Plugin

Postby swingman » Fri May 22, 2020 8:07 am

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.
Christian Batchelor
Certified Servoy Developer
Batchelor Associates Ltd, London, UK
http://www.batchelorassociates.co.uk

http://www.postgresql.org - The world's most advanced open source database.
User avatar
swingman
 
Posts: 1472
Joined: Wed Oct 01, 2003 10:20 am
Location: London

Re: OAuth 2, gSuite.gmail, Mail Plugin

Postby lwjwillemsen » Sat May 23, 2020 8:14 am

+1 Sending email is critical in our applications.
Lambert Willemsen
Vision Development BV
lwjwillemsen
 
Posts: 680
Joined: Sat Mar 14, 2009 5:39 pm
Location: The Netherlands

Re: OAuth 2, gSuite.gmail, Mail Plugin

Postby lwjwillemsen » Sun May 24, 2020 7:54 am

With Google you can use an app password (allso when Basic Auth is disabled). Would that work with the Servoy SMTP send email?
Lambert Willemsen
Vision Development BV
lwjwillemsen
 
Posts: 680
Joined: Sat Mar 14, 2009 5:39 pm
Location: The Netherlands

Re: OAuth 2, gSuite.gmail, Mail Plugin

Postby sbutler » Sat May 30, 2020 1:56 am

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
Scott Butler
iTech Professionals, Inc.
SAN Partner

Servoy Consulting & Development
Servoy University- Training Videos
Servoy Components- Plugins, Beans, and Web Components
Servoy Guy- Tips & Resources
ServoyForge- Open Source Components
User avatar
sbutler
Servoy Expert
 
Posts: 759
Joined: Sun Jan 08, 2006 7:15 am
Location: Cincinnati, OH

Re: OAuth 2, gSuite.gmail, Mail Plugin

Postby patrick » Sat May 30, 2020 3:15 pm

MailPro is also using standard java mail, so it basically works the same.
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: OAuth 2, gSuite.gmail, Mail Plugin

Postby lwjwillemsen » Tue Jun 02, 2020 8:47 pm

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!
Lambert Willemsen
Vision Development BV
lwjwillemsen
 
Posts: 680
Joined: Sat Mar 14, 2009 5:39 pm
Location: The Netherlands

Re: OAuth 2, gSuite.gmail, Mail Plugin

Postby Providence1 » Wed Jun 03, 2020 8:42 pm

+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?
Providence
Providence1
 
Posts: 456
Joined: Tue Aug 17, 2004 2:36 am
Location: New York, NY

Re: OAuth 2, gSuite.gmail, Mail Plugin

Postby Providence1 » Thu Jun 11, 2020 11:29 pm

Can I use the plugins.oauth.serviceBuilder authentication with multi-factor in Office 365? Has anyone been able to accomplish this yet?
Providence
Providence1
 
Posts: 456
Joined: Tue Aug 17, 2004 2:36 am
Location: New York, NY

Re: OAuth 2, gSuite.gmail, Mail Plugin

Postby rafig » Fri Apr 23, 2021 2:01 pm

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
Servoy Certified Developer
Image
rafig
 
Posts: 704
Joined: Mon Dec 22, 2003 12:58 pm
Location: Watford, UK

Previous

Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 13 guests