AnSMTP instance has the following methods:
| level) |
| [host[, port]]) |
| cmd,[, argstring]) |
This returns a 2-tuple composed of a numeric response code and theactual response line (multiline responses are joined into one longline.)
In normal operation it should not be necessary to call this methodexplicitly. It is used to implement other methods and may be usefulfor testing private extensions.
If the connection to the server is lost while waiting for the reply,SMTPServerDisconnected will be raised.
| [hostname]) |
In normal operation it should not be necessary to call this methodexplicitly. It will be implicitly called by thesendmail()when necessary.
| [hostname]) |
Unless you wish to usehas_extn() before sendingmail, it should not be necessary to call this method explicitly. Itwill be implicitly called bysendmail() when necessary.
| name) |
| address) |
Note:Many sites disable SMTP "VRFY" in order to foil spammers.
| user, password) |
| [keyfile[, certfile]]) |
Ifkeyfile andcertfile are provided, these are passed tothesocket module'sssl() function.
| from_addr, to_addrs, msg[, mail_options, rcpt_options]) |
Note:Thefrom_addr andto_addrs parameters areused to construct the message envelope used by the transport agents.TheSMTP does not modify the message headers in any way.
If there has been no previous "EHLO" or "HELO" command thissession, this method tries ESMTP "EHLO" first. If the server doesESMTP, message size and each of the specified options will be passedto it (if the option is in the feature set the server advertises). If"EHLO" fails, "HELO" will be tried and ESMTP optionssuppressed.
This method will return normally if the mail is accepted for at leastone recipient. Otherwise it will throw an exception. That is, if thismethod 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. Each entrycontains a tuple of the SMTP error code and the accompanying errormessage sent by the server.
This method may raise the following exceptions:
Unless otherwise noted, the connection will be open even afteran exception is raised.
| ) |
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 becalled directly, so they are not documented here. For details,consult the module code.