An SMTP instance has the following methods:
If the hostname ends with a colon (":") followed by a number, that suffix will be stripped off and the number interpreted as the port number to use.
Note: This method is automatically invoked by the constructor if a host is specified during instantiation.
This returns a 2-tuple composed of a numeric response code and the actual response line (multiline responses are joined into one long line.)
In normal operation it should not be necessary to call this method explicitly. It is used to implement other methods and may be useful for testing private extensions.
In normal operation it should not be necessary to call this method explicitly. It will be implicitly called by the sendmail() when necessary.
Unless you wish to use has_option() before sending mail, it should not be necessary to call this method explicitly. It will be implicitly called by sendmail() when necessary.
Note: many sites disable SMTP "VRFY" in order to foil spammers.
If there has been no previous "EHLO" or "HELO" command this session, this method tries ESMTP "EHLO" first. If the server does ESMTP, message size and each of the specified options will be passed to it (if the option is in the feature set the server advertises). If "EHLO" fails, "HELO" will be tried and ESMTP options suppressed.
This method will return normally if the mail is accepted for at least one recipient. Otherwise it will throw an exception (either SMTPSenderRefused, SMTPRecipientsRefused, or SMTPDataError). That is, if this method does not throw an exception, then someone should get your mail. If this method does not throw an exception, it returns a dictionary, with one entry for each recipient that was refused.
Low-level methods corresponding to the standard SMTP/ESMTP commands "HELP", "RSET", "NOOP", "MAIL", "RCPT", and "DATA" are also supported. Normally these do not need to be called directly, so they are not documented here. For details, consult the module code.