s365b.notify.senders¶
Ways to send email: Microsoft Graph and SMTP.
Exceptions¶
Sending failed. The message is safe to show. |
Classes¶
Something that can send an email. |
|
Sends as a mailbox through |
|
Sends through an SMTP relay. |
Module Contents¶
- exception s365b.notify.senders.SendError[source]¶
Bases:
ExceptionSending failed. The message is safe to show.
- class s365b.notify.senders.Notifier[source]¶
Bases:
ProtocolSomething that can send an email.
- async send(message: s365b.notify.message.Message, recipients: list[str]) None[source]¶
Send one message.
- Parameters:
message – The message.
recipients – To addresses.
- Raises:
SendError – If sending failed.
- class s365b.notify.senders.GraphNotifier(graph: s365b.graph.client.GraphClient, sender: str)[source]¶
Sends as a mailbox through
/users/{sender}/sendMail.The Notifications app may send only as that mailbox: its
Mail.Sendis an Exchange RBAC assignment scoped to it, not a tenant-wide grant.- Parameters:
graph – Graph client authenticated as the Notifications app.
sender – Sender mailbox address.
- async send(message: s365b.notify.message.Message, recipients: list[str]) None[source]¶
Send one message (not saved to Sent Items).
- Parameters:
message – The message.
recipients – To addresses.
- Raises:
SendError – If Graph refuses or cannot be reached.
- class s365b.notify.senders.SmtpNotifier(host: str, port: int, security: str, sender: str, username: str = '', password: str = '', timeout: float = 30.0)[source]¶
Sends through an SMTP relay.
- Parameters:
host – Relay host.
port – Port.
security –
starttls,tls(implicit) ornone.sender – From address.
username – Login user; empty for none.
password – Login password.
timeout – Socket timeout in seconds.
- async send(message: s365b.notify.message.Message, recipients: list[str]) None[source]¶
Send one message.
- Parameters:
message – The message.
recipients – To addresses.
- Raises:
SendError – For connection, TLS, authentication or relay errors.