(self, msg)
SMTP 'DATA' command -- sends message data to server.

        Automatically quotes lines beginning with a period per rfc821.
        Raises SMTPDataError if there is an unexpected reply to the
        DATA command; the return value from this method is the final
        response code received when the all data is sent.  If msg
        is a string, lone '\\r' and '\\n' characters are converted to
        '\\r\\n' characters.  If msg is bytes, it is transmitted as is.
SMTP 'DATA' command -- sends message data to server.
SMTP DATA command -- sends message data to server .
def data(self, msg):
        """SMTP 'DATA' command -- sends message data to server.

        Automatically quotes lines beginning with a period per rfc821.
        Raises SMTPDataError if there is an unexpected reply to the
        DATA command; the return value from this method is the final
        response code received when the all data is sent.  If msg
        is a string, lone '\\r' and '\\n' characters are converted to
        '\\r\\n' characters.  If msg is bytes, it is transmitted as is.
        """
        self.putcmd("data")
        (code, repl) = self.getreply()
        if self.debuglevel > 0:
            self._print_debug('data:', (code, repl))
        if code != 354:
            raise SMTPDataError(code, repl)
        else:
            if isinstance(msg, str):
                msg = _fix_eols(msg).encode('ascii')
            q = _quote_periods(msg)
            if q[-2:] != bCRLF:
                q = q + bCRLF
            q = q + b"." + bCRLF
            self.send(q)
            (code, msg) = self.getreply()
            if self.debuglevel > 0:
                self._print_debug('data:', (code, msg))
            return (code, msg)
def data ( self , msg ) : self . putcmd ( "data" ) ( code , repl ) = self . getreply ( ) if self . debuglevel > 0 : self . _print_debug ( 'data:' , ( code , repl ) ) if code != 354 : raise SMTPDataError ( code , repl ) else : if isinstance ( msg , str ) : msg = _fix_eols ( msg ) . encode ( 'ascii' ) q = _quote_periods ( msg ) if q [ - 2 : ] != bCRLF : q = q + bCRLF q = q + b"." + bCRLF self . send ( q ) ( code , msg ) = self . getreply ( ) if self . debuglevel > 0 : self . _print_debug ( 'data:' , ( code , msg ) ) return ( code , msg )