'@param fromEmail: The RFC 2821 address from which to send this
message.
@param toEmail: A sequence of RFC 2821 addresses to which to
send this message.
@param file: A file-like object containing the message to send.
@param deferred: A Deferred to callback or errback when sending
of this message completes.
@type deferred: L{defer.Deferred}
@param retries: The number of times to retry delivery of this
message.
@param timeout: Period, in seconds, for which to wait for
server responses, or None to wait forever.'

def __init__(self, fromEmail, toEmail, file, deferred, retries=5, timeout=None):

    assert isinstance(retries, (int, long))
    if isinstance(toEmail, unicode):
        toEmail = [toEmail.encode('ascii')]
    elif isinstance(toEmail, bytes):
        toEmail = [toEmail]
    else:
        toEmailFinal = []
        for _email in toEmail:
            if (not isinstance(_email, bytes)):
                _email = _email.encode('ascii')
            toEmailFinal.append(_email)
        toEmail = toEmailFinal
    self.fromEmail = Address(fromEmail)
    self.nEmails = len(toEmail)
    self.toEmail = toEmail
    self.file = file
    self.result = deferred
    self.result.addBoth(self._removeDeferred)
    self.sendFinished = False
    self.currentProtocol = None
    self.retries = (- retries)
    self.timeout = timeout
