Simple Mail Transfer Protocol interface.
Class SMTP( server, port )
server | A remote server IP or DNS. |
port | A port name or number, defaults to 'smtp'. |
Properties | |
authSchemes | |
heloMsg | |
port | |
server | |
timeout | |
trace | |
Methods | |
auth | Set authentication parameters. |
connect | |
data | |
extractMail | |
helo | |
mailFrom | |
quit | |
rcpt | |
send | Send a MIME part. |
sendTo | Send a mail data to a remote SMTP server. |
Set authentication parameters.
auth( scheme, ... )
scheme | The authentication scheme to be used. |
... | Authentication data (usually, a pair of userid, password parameters). |
Return | self |
Available schemes are:
connect()
data( content )
extractMail( field )
helo()
mailFrom( sender )
quit()
rcpt( target )
Send a MIME part.
send( part )
part | A mime.Part instance. | ||
Raise |
|
Sends a mail to the described recipients. The part must include the From and To headers.
If the Date header is not included, it will be added and set to the current date and date.
See also: mime.
Send a mail data to a remote SMTP server.
sendTo( sender, rcpt, data )
sender | The sender of the mail. |
rcpt | Single or multiple mail target recipients. |
data | A string containing the mail content, properly encoded. |