EMailMessage

Sort of like an RFC822 message, only not limited to its file structure.

Public variables:

fromAddr

The source EMailAddress.

toAddr

A list of destination EMailAddress instances.

date

The date that the message was constructed as a UNIX time value.

subject

Message subject.

cc

A list of cc EMailAddress instances.

bcc

A list of bcc EMailAddress instances.

body

A string representing the body of the message.

XXX should probably store its complete string representation so we don't have to render it every time that we process the queue.

Methods

__init__(self, fromAddr, toAddrs, date, subject, body, cc, bcc)

   def __init__(self, fromAddr, toAddrs, date, subject, body, cc = [], bcc = []):

Constructor. fromAddr is an both instances of EMailAddress, date should be a UNIX time value. subject should be a string. body should also be a string (and may contain newlines). cc, bcc, and toAddrs should both be a list of EMailAddress instances.

_writeAddressList(self, out, addrs)

   def _writeAddressList(self, out, addrs):

Writes a list of addresses to the given output stream.

deliveredTo(self, addr)

   def deliveredTo(self, addr):

This method is used to indicate that the message has been delivered to the given address. The address will be removed from the list of addresses that it must be delivered to.

getDeliveryList(self)

   def getDeliveryList(self):

Returns the list of addresses that the message must still be delivered to sorted by host. Note that this list is the same list that is used internally, so the caller should not attempt to modify it.

writeTo(self, out)

   def writeTo(self, out):

Writes the message onto the given output stream out.