0

Security policy is requiring us to update passwords regularly, and this includes service accounts previously in use for services such as SMTP from our web servers. We are looking to use the Gmail API (Google is the company email provider) to authorize sending emails from the Sitecore web servers for basic email communications with CMS users and admins (password resets, etc.). We understand the Gmail side of things well enough and can create an app and credentials, as outlined here: https://developers.google.com/gmail/api/auth/web-server

However, I do not see any way to do this natively in Sitecore without a custom extension of some kind. Google provides a doc on a custom .NET app to send email, but this is not Sitecore specific. https://developers.google.com/gmail/api/quickstart/dotnet

How could this be done in a manageable way or is there a reliable code resource? I have searched, but find zero.

3
  • Clarification question: When you say sending emails, are you meaning sending just service emails through the .NET provided SMTP provider? Or through something like EXM or Sitecore Send? Jul 27 at 15:35
  • A Security Policy to change service account passwords regularly sounds like a production nightmare. I'm sure your company will regret that decision. Jul 27 at 15:48
  • Just service emails through the .NET provided SMTP provider. Not marketing related.
    – sturtus
    Jul 27 at 20:32

1 Answer 1

0

At it's core, Sitecore is a .NET app, it uses the generic ASP.NET SMTP configuration that's generally setup via the Web.config for simple SMTP.

So, if Google has a solve for a custom .NET app, it should still work.

Sitecore doesn't utilize SMTP much except for the Password email.

If you are creating a custom service message in Sitecore, I am assuming you are using the standard .NET classes for sending mail which is the SmtpClient class found in the System.Net.Mail namespace.

If you are using the simplistic MainUtil.SendMail() method from Sitecore this is simply just a Wrapper method for the .NET SmtpClient.

So, using the Google provided solve for a custom .NET class should work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.