Back to index

python3.2  3.2.2
Classes | Functions | Variables
smtplib Namespace Reference

Classes

class  SMTPException
class  SMTPServerDisconnected
class  SMTPResponseException
class  SMTPSenderRefused
class  SMTPRecipientsRefused
class  SMTPDataError
class  SMTPConnectError
class  SMTPHeloError
class  SMTPAuthenticationError
class  SSLFakeFile
class  SMTP
class  SMTP_SSL
class  LMTP

Functions

def quoteaddr
def _addr_only
def quotedata
def _quote_periods
def _fix_eols
def prompt

Variables

list __all__
int SMTP_PORT = 25
int SMTP_SSL_PORT = 465
string CRLF = "\r\n"
string bCRLF = "\r\n"
tuple OLDSTYLE_AUTH = re.compile(r"auth=(.*)", re.I)
 _have_ssl = False
int LMTP_PORT = 2003
tuple fromaddr = prompt("From")
tuple toaddrs = prompt("To")
string msg = ''
tuple line = sys.stdin.readline()
tuple server = SMTP('localhost')

Function Documentation

def smtplib._addr_only (   addrstring) [private]

Definition at line 155 of file smtplib.py.

00155 
00156 def _addr_only(addrstring):
00157     displayname, addr = email.utils.parseaddr(addrstring)
00158     if (displayname, addr) == ('', ''):
00159         # parseaddr couldn't parse it, so use it as is.
00160         return addrstring
00161     return addr
00162 
# Legacy method kept for backward compatibility.

Here is the call graph for this function:

Here is the caller graph for this function:

def smtplib._fix_eols (   data) [private]

Definition at line 175 of file smtplib.py.

00175 
00176 def _fix_eols(data):
00177     return  re.sub(r'(?:\r\n|\n|\r(?!\n))', CRLF, data)
00178 
00179 try:
    import ssl

Here is the call graph for this function:

Here is the caller graph for this function:

def smtplib._quote_periods (   bindata) [private]

Definition at line 172 of file smtplib.py.

00172 
00173 def _quote_periods(bindata):
00174     return re.sub(br'(?m)^\.', b'..', bindata)

Here is the call graph for this function:

Here is the caller graph for this function:

def smtplib.prompt (   prompt)

Definition at line 911 of file smtplib.py.

00911 
00912     def prompt(prompt):
00913         sys.stdout.write(prompt + ": ")
00914         return sys.stdin.readline().strip()

Here is the caller graph for this function:

def smtplib.quoteaddr (   addr)
Quote a subset of the email addresses defined by RFC 821.

Should be able to handle anything email.utils.parseaddr can handle.

Definition at line 136 of file smtplib.py.

00136 
00137 def quoteaddr(addr):
00138     """Quote a subset of the email addresses defined by RFC 821.
00139 
00140     Should be able to handle anything email.utils.parseaddr can handle.
00141     """
00142     m = (None, None)
00143     try:
00144         m = email.utils.parseaddr(addr)[1]
00145     except AttributeError:
00146         pass
00147     if m == (None, None):  # Indicates parse failure or AttributeError
00148         # something weird here.. punt -ddm
00149         return "<%s>" % addr
00150     elif m is None:
00151         # the sender wants an empty return address
00152         return "<>"
00153     else:
00154         return "<%s>" % m

Here is the call graph for this function:

Here is the caller graph for this function:

def smtplib.quotedata (   data)
Quote data for email.

Double leading '.', and change Unix newline '\\n', or Mac '\\r' into
Internet CRLF end-of-line.

Definition at line 163 of file smtplib.py.

00163 
00164 def quotedata(data):
00165     """Quote data for email.
00166 
00167     Double leading '.', and change Unix newline '\\n', or Mac '\\r' into
00168     Internet CRLF end-of-line.
00169     """
00170     return re.sub(r'(?m)^\.', '..',
00171         re.sub(r'(?:\r\n|\n|\r(?!\n))', CRLF, data))

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Initial value:
00001 ["SMTPException", "SMTPServerDisconnected", "SMTPResponseException",
00002            "SMTPSenderRefused", "SMTPRecipientsRefused", "SMTPDataError",
00003            "SMTPConnectError", "SMTPHeloError", "SMTPAuthenticationError",
00004            "quoteaddr", "quotedata", "SMTP"]

Definition at line 56 of file smtplib.py.

Definition at line 181 of file smtplib.py.

Definition at line 64 of file smtplib.py.

string smtplib.CRLF = "\r\n"

Definition at line 63 of file smtplib.py.

tuple smtplib.fromaddr = prompt("From")

Definition at line 915 of file smtplib.py.

tuple smtplib.line = sys.stdin.readline()

Definition at line 920 of file smtplib.py.

Definition at line 863 of file smtplib.py.

Definition at line 918 of file smtplib.py.

tuple smtplib.OLDSTYLE_AUTH = re.compile(r"auth=(.*)", re.I)

Definition at line 66 of file smtplib.py.

tuple smtplib.server = SMTP('localhost')

Definition at line 926 of file smtplib.py.

Definition at line 61 of file smtplib.py.

Definition at line 62 of file smtplib.py.

tuple smtplib.toaddrs = prompt("To")

Definition at line 916 of file smtplib.py.