(self)
Do email message validation.
Do email message validation.
Do email message validation .
def validate(self):
        """Do email message validation.
        """
        if not (self.to or self.cc or self.bcc):
            raise SenderError("does not specify any recipients(to,cc,bcc)")
        if not self.fromaddr:
            raise SenderError("does not specify fromaddr(sender)")
        for c in '\r\n':
            if self.subject and (c in self.subject):
                raise SenderError('newline is not allowed in subject')
def validate ( self ) : if not ( self . to or self . cc or self . bcc ) : raise SenderError ( "does not specify any recipients(to,cc,bcc)" ) if not self . fromaddr : raise SenderError ( "does not specify fromaddr(sender)" ) for c in '\r\n' : if self . subject and ( c in self . subject ) : raise SenderError ( 'newline is not allowed in subject' )