Issues in starting a call to send an email via SDK

I am trying to send an email from Confluence via the SDK, I have what I believe I need from:

  1. Import com.atlassian.mail.Email;
  2. Import com.atlassian.mail.Server.SMTPServer;

The issue is with initialising the smtpMailServer – I have seen in Jira it is done with
ComponentAccessor.getMailServerManager().getDefaultSMTPMailServer();
but the ComponentAccessor is within a com.atlassian.jira package – what is the equivalent/ how should it be done in confluence?
Many thanks in advance

Dear @JWNewbie ,

in our apps we do the following:

  1. Get com.atlassian.mail.server.MailServerManager via MailFactory.getServerManager()
  2. Get the STMP Server via mailServerManager.getDefaultSMTPMailServer()

I hope that helps.

Best regards

Andreas