async def METHOD_NAME(
    *, message: MIMEText | MIMEMultipart, settings: SMTPSettings
) -> None:
    # WARNING: _do_send_mail is mocked so be careful when changing the signature or name !!
    logger.debug("Email configuration %s", settings.json(indent=1))
    if settings.SMTP_PORT == 587:
        # NOTE: aiosmtplib does not handle port 587 correctly this is a workaround
        try:
            smtp = _create_smtp_client(settings)
            if settings.SMTP_PROTOCOL == EmailProtocol.STARTTLS:
                logger.info("Unencrypted connection attempt to mailserver ...")
                await smtp.connect(use_tls=False, port=settings.SMTP_PORT)
                logger.info("Starting STARTTLS ...")
                await smtp.starttls()
            elif settings.SMTP_PROTOCOL == EmailProtocol.TLS:
                await smtp.connect(use_tls=True, port=settings.SMTP_PORT)
            elif settings.SMTP_PROTOCOL == EmailProtocol.UNENCRYPTED:
                logger.info("Unencrypted connection attempt to mailserver ...")
                await smtp.connect(use_tls=False, port=settings.SMTP_PORT)
            if settings.SMTP_USERNAME and settings.SMTP_PASSWORD:
                logger.info("Attempting a login into the email server ...")
                await smtp.login(
                    settings.SMTP_USERNAME, settings.SMTP_PASSWORD.get_secret_value()
                )
            await smtp.send_message(message)
        finally:
            await smtp.quit()
    else:
        async with _create_smtp_client(settings) as smtp:
            if settings.SMTP_USERNAME and settings.SMTP_PASSWORD:
                logger.info("Login email server ...")
                await smtp.login(
                    settings.SMTP_USERNAME, settings.SMTP_PASSWORD.get_secret_value()
                )
            await smtp.send_message(message)