def METHOD_NAME(
    flask_app: Flask,
    rcpt: str,
    subject: str,
    msg: str,
    mail_from: str = app.config["MAIL_FROM"],
    reply_to: str = app.config["NOREPLY_EMAIL"],
    bcc: str = "",
    reply_all: bool = False,
) -> None:
    with flask_app.app_context():
        s = smtplib.SMTP(flask_app.config["MAIL_HOST"]) if not is_localhost() else None
        rcpts = rcpt.split(";")
        mail_targets: list[str | list[str]] = list(rcpts) if not reply_all else [rcpts]
        bccmail = bcc
        extra = ""
        if bcc:
            if len(rcpts) > 3:
                mail_targets.append(bcc)
                bccmail = ""
                extra = "\n\n" + "\n".join(rcpts)
        try:
            for rcp in mail_targets:
                try:
                    # TODO: Mailmerge here possible templates.
                    send_extra = ""
                    send_to = rcp if isinstance(rcp, list) else [rcp]
                    send_to = [m for m in send_to if m]
                    send_to_str = ",".join(send_to)
                    if bccmail:
                        send_to.append(bccmail)
                    if rcp == bcc:
                        send_extra = extra
                    mime_msg = MIMEText(
                        msg + send_extra
                    )  # + flask_app.config['MAIL_SIGNATURE'])
                    mime_msg["Subject"] = subject
                    mime_msg["From"] = mail_from
                    mime_msg["Bcc"] = bccmail
                    mime_msg["To"] = send_to_str
                    mime_msg["Date"] = formatdate(localtime=True)
                    if reply_to:
                        mime_msg.add_header("Reply-To", reply_to)
                    if not s:
                        # don't use log_* function because this is typically run in Celery
                        print(
                            f"Dry run send mail, from: {mail_from}, send_to: {send_to},  message: {mime_msg.as_string()}"
                        )
                    else:
                        s.sendmail(mail_from, send_to, mime_msg.as_string())
                except (
                    smtplib.SMTPSenderRefused,
                    smtplib.SMTPRecipientsRefused,
                    smtplib.SMTPHeloError,
                    smtplib.SMTPDataError,
                    smtplib.SMTPNotSupportedError,
                ) as e:
                    log_error(str(e))
                else:
                    pass
        finally:
            if s:
                s.quit()