SMTP methods and classes.
Typical usage:
smtp = interface.smtp|connect('smtp.gmail.com',1234,'google.com');
smtp|setheader("From","Michael Edgar
interface.smtp.SMTPFatalErrorException
: Something has gone terribly, terribly wrong.interface.smtp.SMTPServerBusyException
: The SMTP server is busy right now.interface.smtp.SMTPSyntaxErrorException
: The input command was invalid.interface.smtp.SMTPUnknownException
: Unsure what this error code, or, I just don't care.interface.smtp.response
: interface.smtp.smtp_connection
: conn
: The SMTP connection that we work with, which handles all the socket logic. headers
: The Headers to send in the message. You should handle these with setheader(). close()
: Closes the connection with the SMTP server, which also includes sending "QUIT". connect(host, port, helo)
: Connects to an smtp server at the given host and port, and identifies with the domain given
by +helo+.
host: the SMTP server to connect to.
port: the port the server is running on.
helo: the domain you serve to the HELO command - needed by 90% of the servers out there,
or you will be blocked as a spambot.
sendemail(message, emailfrom, recipients)
: Sends the specified SMTP message, from the sepcified person, to the list of recipients.
message: the raw message to send. Could be HTML or plaintext.
emailfrom: the specified sender of the email.
recipients: the people you will send the email to, in any data type supporting iterators.
setheader(key, value)
: Sets a mail header for the message you will send.
key: Header key, e.g. "From" in "From: mje@michaeledgar.com"
value: Header value, e.g. "mje@michaeledgar.com" in "From: mje@michaeledgar.com"