Email - Send and receive email via SMTP and IMAP.
| Class | IMAP4 |
A minimal IMAP4 client for MicroPython. |
| Class | |
Threaded IMAP helper so network fetches don't block the UI. |
| Class | SMTP |
A minimal SMTP client for MicroPython. |
| Class | |
Threaded version of SMTP for sending emails "asynchronously" |
| Function | imap |
Fetch a single email by IMAP UID. |
| Function | imap |
Fetch summaries of the most recent unread emails. |
| Function | imap |
Mark an email as seen by IMAP UID. |
| Function | run |
Run the app. |
| Function | start |
Start the app. |
| Function | stop |
Stop the app. |
| Constant | AUTH |
Undocumented |
| Constant | AUTH |
Undocumented |
| Constant | CMD |
Undocumented |
| Constant | CMD |
Undocumented |
| Constant | CMD |
Undocumented |
| Constant | CMD |
Undocumented |
| Constant | DEFAULT |
Undocumented |
| Constant | EMAIL |
Undocumented |
| Constant | EMAIL |
Undocumented |
| Constant | EMAIL |
Undocumented |
| Constant | EMAIL |
Undocumented |
| Constant | IMAP |
Undocumented |
| Constant | KEYBOARD |
Undocumented |
| Constant | KEYBOARD |
Undocumented |
| Constant | LOCAL |
Undocumented |
| Constant | MAX |
Undocumented |
| Constant | MENU |
Undocumented |
| Constant | MENU |
Undocumented |
| Constant | MENU |
Undocumented |
| Constant | MENU |
Undocumented |
| Constant | MENU |
Undocumented |
| Constant | SENDING |
Undocumented |
| Constant | SENDING |
Undocumented |
| Constant | SENDING |
Undocumented |
| Constant | VIEW |
Undocumented |
| Constant | VIEW |
Undocumented |
| Constant | VIEW |
Undocumented |
| Constant | VIEW |
Undocumented |
| Constant | VIEW |
Undocumented |
| Constant | VIEW |
Undocumented |
| Constant | VIEW |
Undocumented |
| Constant | VIEW |
Undocumented |
| Constant | VIEW |
Undocumented |
| Variable | email |
Undocumented |
| Variable | recipient |
Undocumented |
| Variable | sender |
Undocumented |
| Variable | sender |
Undocumented |
| Variable | sender |
Undocumented |
| Variable | smtp |
Undocumented |
| Function | __await |
Wait for email sending to complete. |
| Function | __load |
Load email credentials from storage. |
| Function | _b64decode |
Decode base64 bytes, tolerating whitespace and missing padding. |
| Function | _back |
Return from viewing an email to the email list. |
| Function | _build |
Build the List widget from the fetched unread emails. |
| Function | _decode |
Decode a MIME body part into a unicode string. |
| Function | _decode |
Decode RFC 2047 encoded-words in a header value. |
| Function | _email |
Run the email list view. |
| Function | _email |
Run the single-email view. |
| Function | _extract |
Extract the email address from a From/To header value. |
| Function | _extract |
Extract the plain-text body from a raw MIME body + headers dict. |
| Function | _first |
Get the first value for a header name. |
| Function | _header |
Get a parameter value from a header value. |
| Function | _keyboard |
Start the keyboard view. |
| Function | _keyboard |
Keyboard callback to save the entered value. |
| Function | _loading |
Start the loading view. |
| Function | _mark |
Mark the current email as seen, then refresh the unread list. |
| Function | _menu |
Start the menu view. |
| Function | _open |
Open a single email: fetch its body and show it. |
| Function | _parse |
Parse a raw header block into a dict of name -> [values]. |
| Function | _q |
Decode an RFC 2047 Q-encoded string into unicode. |
| Function | _qp |
Decode a quoted-printable byte string. |
| Function | _reset |
Clear the email list state. |
| Function | _show |
Render a fetched email in a scrollable text box. |
| Function | _split |
Split an RFC822 message into (header_blob, body_blob). |
| Function | _walk |
Walk a multipart body and return concatenated text/plain parts. |
| Variable | _current |
Undocumented |
| Variable | _email |
Undocumented |
| Variable | _email |
Undocumented |
| Variable | _imap |
Undocumented |
| Variable | _loading |
Undocumented |
| Variable | _menu |
Undocumented |
| Variable | _message |
Undocumented |
| Variable | _unread |
Undocumented |
Fetch a single email by IMAP UID.
| Parameters | |
fromstr | The sender email. |
fromstr | The sender app password. |
uid:str | The message UID. |
markbool | Mark the email as seen. Defaults to False. |
| Returns | |
dict or None | The email details. |
| Raises | |
OSError | On connection errors. |
Fetch summaries of the most recent unread emails.
| Parameters | |
fromstr | The sender email. |
fromstr | The sender app password. |
limit:int | Maximum number of emails. Defaults to 10. |
| Returns | |
list | uid/subject/from/to/date dicts (newest first). |
| Raises | |
OSError | On connection or auth errors. |
Mark an email as seen by IMAP UID.
| Parameters | |
fromstr | The sender email. |
fromstr | The sender app password. |
uid:str | The message UID. |
| Returns | |
bool | True on success. |
Start the app.
| Parameters | |
viewViewManager | The view manager context. |
| Returns | |
bool | True on success. |
Load email credentials from storage.
| Parameters | |
viewViewManager | The view manager context. |
| Returns | |
bool | True if credentials are set. |
Decode base64 bytes, tolerating whitespace and missing padding.
| Parameters | |
data:bytes or str | The base64 data. |
| Returns | |
bytes | The decoded bytes. |
Return from viewing an email to the email list.
| Parameters | |
viewViewManager | The view manager context. |
Build the List widget from the fetched unread emails.
| Parameters | |
viewViewManager | The view manager context. |
Decode a MIME body part into a unicode string.
| Parameters | |
data:bytes | The body part data. |
cte:str | The content transfer encoding. |
charset:str | The character set. Defaults to None. |
| Returns | |
str | The decoded text. |
Decode RFC 2047 encoded-words in a header value.
| Parameters | |
raw:str | The header value. |
| Returns | |
str | The decoded value. |
Run the email list view.
| Parameters | |
viewViewManager | The view manager context. |
| Returns | |
bool | False when leaving the view. |
Run the single-email view.
| Parameters | |
viewViewManager | The view manager context. |
| Returns | |
bool | False when leaving the view. |
Extract the email address from a From/To header value.
| Parameters | |
header:str | The header value. |
| Returns | |
str | The email address. |
Extract the plain-text body from a raw MIME body + headers dict.
| Parameters | |
bodybytes | The message body. |
headers:dict | Parsed headers. |
| Returns | |
str | The plain-text body. |
Get the first value for a header name.
| Parameters | |
headers:dict | Parsed headers. |
name:str | The header name. |
| Returns | |
str | The first value, or "". |
Get a parameter value from a header value.
| Parameters | |
headerstr | The header value. |
param:str | The parameter name. |
| Returns | |
str or None | The parameter value. |
Start the keyboard view.
| Parameters | |
viewViewManager | The view manager context. |
| Returns | |
bool | True while the keyboard is active. |
Keyboard callback to save the entered value.
| Parameters | |
viewViewManager | The view manager context. |
| Returns | |
bool | True on success. |
Start the loading view.
| Parameters | |
viewViewManager | The view manager context. |
message:str | The loading message. Defaults to "Sending...". |
Mark the current email as seen, then refresh the unread list.
| Parameters | |
viewViewManager | The view manager context. |
Open a single email: fetch its body and show it.
| Parameters | |
viewViewManager | The view manager context. |
summary:dict | The email summary. |
Parse a raw header block into a dict of name -> [values].
| Parameters | |
headerbytes or str | The raw header block. |
| Returns | |
dict | Header names mapped to value lists. |
Decode an RFC 2047 Q-encoded string into unicode.
| Parameters | |
s:str | The Q-encoded string. |
| Returns | |
str | The decoded string. |
Decode a quoted-printable byte string.
| Parameters | |
data:bytes | The quoted-printable data. |
| Returns | |
bytes | The decoded bytes. |
Render a fetched email in a scrollable text box.
| Parameters | |
viewViewManager | The view manager context. |
data:dict | The email details. |
Split an RFC822 message into (header_blob, body_blob).
| Parameters | |
literal:bytes | The raw message. |
| Returns | |
tuple | (header_blob, body_blob). |