Last page update: September 28, 2011
Main class:
Exceptions classes:
Complete reference:
there is no public method.
Base class for exceptions resulting from SSL negotiation
This class provides SSL access to an SMTP server.
SMTP over SSL typical listens on port 465. Unlike StartTLS, SMTP over SSL makes an SSL connection before doing a helo/ehlo. All transactions, then, are done over an encrypted channel.
This class is a simple subclass of the smtplib.SMTP class that comes with Python. It overrides the connect() method to use an SSL socket, and it overrides the starttls() function to throw an error (you can’t do starttls within an SSL session)
Connect to an SMTP server using SSL.
‘host’ is localhost by default. Port will be set to 465 (the default SSL SMTP port) if no port is specified.
If the host name ends with a colon (‘:’) followed by a number, that suffix will be stripped off and the number interpreted as the port number to use. This will override the ‘port’ parameter.
Note
this method is automatically invoked by __init__, if a host is specified during the instantiation
Set the absolute path to a file containing a x.509 certificate.
This method will only be effective if it is called before connect()
This certificate will be used to make the SSL connection.
Set the absolute path to a file containing a private key.
This method will only be effective if it is called before connect()
This key will be used to make the SSL connection.
Raises an exception.
You cannot do StartTLS inside of an ssl session. Calling starttls() will return an SMTPSSLException