class documentation
A minimal SMTP client for MicroPython.
| Method | __init__ |
Connect to an SMTP server. |
| Method | cmd |
Send a command and read the multi-line response. |
| Method | login |
Authenticate with the SMTP server. |
| Method | quit |
Send QUIT and close the connection. |
| Method | send |
Send the message body and termination sequence. |
| Method | to |
Set the mail recipients and start the DATA phase. |
| Method | write |
Write raw content to the SMTP socket. |
| Instance Variable | username |
Undocumented |
| Instance Variable | _sock |
Undocumented |
Connect to an SMTP server.
| Parameters | |
host:str | The server hostname. |
port:int | The server port. |
ssl:bool | Use SSL/TLS. Defaults to False. |
username:str | The login username. Defaults to None. |
password:str | The login password. Defaults to None. |
Send a command and read the multi-line response.
| Parameters | |
cmdstr | The SMTP command to send. |
| Returns | |
tuple | (code, response lines). |
Authenticate with the SMTP server.
| Parameters | |
username:str | The login username. |
password:str | The login password. |
| Returns | |
tuple | (code, response lines). |
Send the message body and termination sequence.
| Parameters | |
content:str | The message body. Defaults to "". |
| Returns | |
tuple | (code, response text). |
Set the mail recipients and start the DATA phase.
| Parameters | |
addrs:str or list | Recipient address(es). |
mailstr | The sender address. Defaults to None. |
| Returns | |
tuple | (code, response lines). |