Mailer

A Mailer manages a connection to a single sendmail daemon.

Methods

__init__(self, host, debug)

   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.

readline(self)

   def readline(self):

Returns the next CR/LF or LF terminated line from the server.

This is normally for internal use only.

send(self, data)

   def send(self, data):

Sends data (a string) to the mail daemon at the other end.

This is normally for internal use only.

sendMessage(self, fromUser, toUser, messageBody)

   def sendMessage(self, fromUser, toUser, messageBody):

Sends the message in the messageBody string to the user identified by toUser. toUser and fromUser should both be instances of EMailAddress.

waitFor(self, code)

   def waitFor(self, code):

Waits for a particular 3 character code from the server, discards all 220's that are returned.

waitFor220(self)

   def waitFor220(self):

Waits for a 220 line from the server.

This is normally for internal use only.