Mail library supporting Google OAuth for Gmail?

148 views
Skip to first unread message

Ignacio Grande

unread,
Dec 27, 2019, 1:23:27 PM12/27/19
to golang-nuts
Hi!

I have an application I made a few years ago for a friend which sends emails using a Gmail account with STMP, using the library gopkg.in/gomail.v1. Since then I moved on and I'm not familiar with latest changes in Gmail or the library.

It seems Google is dropping access for LSA (less secure apps) in June and I've been asked if I can update the apps to work with OAuth.

I've doing some research and it seems that:
  • gomail.v1 moved to gomail.v2, but it was abandoned several years ago.
  • I cannot configure SMTP access in my Gmail account. Has STMP support dropped from Gmail? Current account works, so maybe it is not possible to activate it but accounts already using it works? Do you know if this will last?
I guess it's time to learn how to use IMAP and OAuth in Go with Gmail to update the app. Can you tell me of any tutorial/library to use?

Thanks a lot.


Shane H

unread,
Dec 28, 2019, 1:42:01 AM12/28/19
to golang-nuts
So I recently created some code that uses Gmail to send .. mail..
https://developers.google.com/gmail/api/quickstart/go has instructions and example (Go) code that you can use. I split the token code off to its own standalone pkg so that any code could then use the creds+tokens to send emails, without the need to y/n all the time. 
Reply all
Reply to author
Forward
0 new messages