1

I have Google workspace, created for my mail application passwords and used the code as password in my .NET application. This worked for me in test application without Google workspace, from private mail.

However now I want to use it with custom domain and this does not work. If you recommend OAuth, then please link proper article on how to connect OAuth SMTP functionality with external application (any language, can be even bash). Currently, I get an error

535: 5.7.8 Username and Password not accepted.

Steps to reproduce:

  • domain on domain distributor
  • add it to google workspace
  • google workspace mail -> application passwords -> generate 16char password
  • in .NET:
await client.AuthenticateAsync(googleWorkspaceGmail, googleWorkspaceGmailApplicationPassword);

Edit: what should I use instead of google workspace to achieve my goal? What is the standard?

7
  • 1
    "Starting May 1, 2025, Google Workspace accounts no longer support less secure apps, third-party apps, or devices that ask you to sign in to your Google Account with your username and password. You must use OAuth to let these apps and devices access your account." support.google.com/a/answer/6260879?hl=en So you can't use SmtpClient at all, you'll need to find another library such as MailKit Commented Jul 10 at 22:56
  • I am using MailKit indeed. So how do I send an email from google now? I am seconds from abandoning google hilarious security measures that deprive me of sending simple register confirmation emails from my backend application. Commented Jul 10 at 23:01
  • 1
    A little bit of googling turns up this github.com/jstedfast/MailKit/blob/master/GMailOAuth2.md Commented Jul 10 at 23:07
  • This tells nothing - only that i have to buy another google subscription for cloud and manage my mailing service there. So I am moving to Postmark Commented Jul 11 at 11:33
  • There's explicit instructions how to use the Google Developer Console to generate OAuth creds. You don't need need to sign up to anything, you can use your normal Google login. Commented Jul 11 at 11:36

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.