ORIONIS API REFERENCE

THE ORIONIS API

Build with clarity.

Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.

class documentation

class SmtpTransport(IMailTransport): (source)

Constructor: SmtpTransport(settings)

View In Hierarchy

Use one verified SMTP connection per message, entirely on a worker.

Cancelling the awaiting task does not stop the worker and does not prove that the server refused the message. There are no automatic retries.

Method __init__ Retain validated settings without opening a connection.
Method _result Report exactly the recipients accepted by a completed transaction.
Method _sendBatchSync Own one SMTP session for the complete bounded batch.
Method _sendSync Connect, negotiate, authenticate, transmit, and always close.
Async Method send Run the complete blocking SMTP cycle outside the event loop.
Async Method sendMany Send a bounded batch using one authenticated connection and no retries.
Class Variable __slots__ Declare the instance attribute slots reserved by this class.
Instance Variable _settings Immutable effective connection options.
def __init__(self: Self, settings: SmtpSettings): (source)

Retain validated settings without opening a connection.

Parameters
settings:orionis.mail.entities.SmtpSettingsImmutable effective connection options.
Returns
NoneStore transport configuration only.
def _result(self: Self, message: PreparedMail, mailer: str, driver: str, refused: Mapping[str, tuple[int, bytes | str]]) -> MailResult: (source)

Report exactly the recipients accepted by a completed transaction.

Parameters
message:orionis.mail.entities.PreparedMailIntended recipient union and message identifier.
mailer:strSelected configuration name.
driver:strRegistered driver name.
refused:collections.abc.Mapping[str, tuple[int, bytes | str]]Recipient rejections returned after the transaction succeeded.
Returns
orionis.mail.entities.MailResultAccepted or partial, with sanitized immutable rejection metadata.
Raises
orionis.mail.exceptions.MailTransportExceptionIf no recipient was accepted.
def _sendBatchSync(self: Self, messages: tuple[PreparedMail, ...], mailer: str, driver: str) -> tuple[MailResult, ...]: (source)

Own one SMTP session for the complete bounded batch.

Parameters
messages:tuple[orionis.mail.entities.PreparedMail, ...]Prepared messages to send through one SMTP session.
mailer:strConfigured mailer name attached to delivery results.
driver:strTransport driver name attached to delivery results.
Returns
tuple[orionis.mail.entities.MailResult, ...]Delivery results in message order after the complete batch succeeds.
def _sendSync(self: Self, message: PreparedMail, mailer: str, driver: str) -> MailResult: (source)

Connect, negotiate, authenticate, transmit, and always close.

Parameters
message:orionis.mail.entities.PreparedMailComplete operation-local message.
mailer:strSelected configuration name.
driver:strRegistered driver name.
Returns
orionis.mail.entities.MailResultConfirmed recipient acceptance after a successful transaction.
Raises
orionis.mail.exceptions.MailTransportExceptionSanitized failure identifying stage, exception type, and SMTP code.
async def send(self: Self, message: PreparedMail, *, mailer: str, driver: str) -> MailResult: (source)

Run the complete blocking SMTP cycle outside the event loop.

Parameters
message:orionis.mail.entities.PreparedMailAlready materialized MIME and a validated separate envelope.
mailer:strConfiguration name reported in the result.
driver:strRegistered transport name reported in the result.
Returns
orionis.mail.entities.MailResultTotal or partial acceptance confirmed by the SMTP transaction.
Raises
orionis.mail.exceptions.MailTransportExceptionIf the transaction fails or every recipient is rejected.
async def sendMany(self: Self, messages: Iterable[PreparedMail], *, mailer: str, driver: str) -> tuple[MailResult, ...]: (source)

Send a bounded batch using one authenticated connection and no retries.

Parameters
messages:collections.abc.Iterable[orionis.mail.entities.PreparedMail]At most 100 already-composed messages with these transport settings.
mailer:strMailer identifier included in results.
driver:strDriver identifier included in results.
Returns
tuple[orionis.mail.entities.MailResult, ...]Ordered delivery results. MailBatchException retains completed results and the uncertain message index if the batch aborts. Cancellation waits for the accepted batch before closing resources.
__slots__: tuple[str, ...] = (source)

Declare the instance attribute slots reserved by this class.

_settings = (source)

Immutable effective connection options.