A Mailer manages a connection to a single sendmail daemon.
def __init__(self, host, debug = 0):
Constructs a new Mailer object, creating a connection to the specified host. host should be a string specifying either a dotted ip address or a host name.
if debug is true, all sends and receives are printed.
Returns the next CR/LF or LF terminated line from the server.
This is normally for internal use only.
Sends data (a string) to the mail daemon at the other end.
This is normally for internal use only.
Sends the message in the messageBody string to the user identified by
toUser. toUser and fromUser should both be instances of EMailAddress.
Waits for a particular 3 character code from the server, discards all 220's
that are returned.
Waits for a 220 line from the server.
This is normally for internal use only.
readline(self)
def readline(self):
send(self, data)
def send(self, data):
sendMessage(self, fromUser, toUser, messageBody)
def sendMessage(self, fromUser, toUser, messageBody):
waitFor(self, code)
def waitFor(self, code):
waitFor220(self)
def waitFor220(self):