async def _send_email_sync(self, msg: MIMEMultipart) -> None:
        """Synchronous email sending wrapped in asyncio executor."""
        loop = asyncio.get_running_loop()

        def _send():
            with smtplib.SMTP_SSL(
                self.smtp_server,
                self.smtp_port,
                context=self.ssl_context,
                timeout=30,
            ) as server:
                logger.info("Connected to SMTP server")
                server.login(self.smtp_username, self.smtp_password)
                logger.info("Login successful")
                server.send_message(msg)
                logger.info("Message sent successfully!")

        try:
            await loop.run_in_executor(None, _send)
        except Exception as e:
            error_msg = f"Failed to send email: {str(e)}"
            logger.error(error_msg)
            raise RuntimeError(error_msg) from e
Synchronous email sending wrapped in asyncio executor.
py/core/providers/email/smtp.py