GMail OAuth2 Scope for SMTP vs REST API

There’s confusion about the OAuth2 scope required to send email via GMAIL. There are two ways to programmatically send email using your GMail account: Connecting to smtp.gmail.com using the SMTP protocol (i.e. using Chilkat.MailMan) Calling the GMail REST API over HTTPS using Chilkat.Http or Chilkat.Rest.   The scope for IMAP, POP, and SMTP access is https://mail.google.com/ See https://developers.google.com/gmail/imap/xoauth2-protocol If your […]

Google to Discontinue Authentication that Requires Users to Share their Google username and password

Beginning September 30, 2024: third-party apps that use only a password to access Google Accounts and Google Sync will no longer be supported See https://workspaceupdates.googleblog.com/2023/09/winding-down-google-sync-and-less-secure-apps-support.html Does this mean “App Passwords” will be discontinued? I don’t think so, but I’m not 100% sure. Google did not explicitly clarify. The reason I think App Passwords will still be a valid authentication mechanism, […]

GMail Mailboxes vs Labels

GMail technically doesn’t use mailboxes or folders. Instead it uses “labels”. Labels appear as folders (i.e. mailboxes) in email clients such as Outlook or Thunderbird, or as mailboxes in the IMAP protocol. See https://hiverhq.com/blog/labels-vs-folders-guide I recommend  comparing how your GMail looks in Outlook (or Thunderbird) vs the web browser at Gmail.com. Notice how an email can be given multiple labels, […]

GMail SMTP with Send-Only Scope? (https://www.googleapis.com/auth/gmail.send)

Apparently the full permission scope is required to do XOAUTH2 authentication in the SMTP protocol for GMail. See these examples https://www.example-code.com/vbnet/gmail_smtp_oauth2_access_token.asp https://www.example-code.com/vbnet/gmail_smtp_send_using_oauth2_token.asp The full permission scope is “https://mail.google.com/” The send-only scope is: “https://www.googleapis.com/auth/gmail.send” Google claims that it’s possible to send email with the send-only scope, but we’ve found it is  simply possible.  It just doesn’t work. Don’t know why. Perhaps […]

GMail IMAP NO [AUTHENTICATIONFAILED] Invalid credentials (Failure)

You passed the correct login/password to login to imap.gmail.com, but you still get an “Invalid credentials” error.  What gives? For example, you called Chilkat’s Imap.Login method, passing the correct login/password, and the imap.LastErrorText contains this: authenticateLogin(110ms): loginImap(110ms): ConnectionType: SSL/TLS ImapCmdSent: aaab LOGIN “you@gmail.com” getCompleteResponse(110ms): ImapCmdResp: aaab NO [AUTHENTICATIONFAILED] Invalid credentials (Failure) –getCompleteResponse –loginImap isOK: serverResponse: aaab NO [AUTHENTICATIONFAILED] Invalid credentials […]

GMail IMAP OAuth2 – A Walkthrough

This blog post covers from start to finish the process for getting a desktop application working with GMail using the IMAP protocol with OAuth2 authentication. Start here:  https://console.developers.google.com/apis/credentials (1) The first step is to create credentials.  Your app is a desktop application.  HOWEVER, you will be creating credentials as if your app is a web app. See this YouTube video […]