Hello,
We are having a bit of a discussion internally on Google’s recommended “Most secure” way to send emails programmatically. We have things like invoices and shipping notifications that we send out to customers and thus we don’t have a user signing in with OAuth. We use C# for coding Windows Forms that run processes and we have a few web services that run things.
I have found that setting up a SMTP Relay for Printers, Devices and Apps says this is the most secure way to send emails when there is no need for user intervention.
My coworker says that OAUTH 2.0 using a Service Account with Domain Wide Delegation is more secure.
We are currently using C#'s SMTP client which requires Username and App Password which we store securely; however, we are looking to move away from storing any credentials locally.
Considering Google doesn’t define this clearly in documentation, I am curious what the experts have to say as I’ve only been working with APIS and stuff for a couple of years.