MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / data

Method data

tools/python-3.11.9-amd64/Lib/smtplib.py:556–583  ·  view source on GitHub ↗

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 wh

(self, msg)

Source from the content-addressed store, hash-verified

554 return self.getreply()
555
556 def data(self, msg):
557 """SMTP 'DATA' command -- sends message data to server.
558
559 Automatically quotes lines beginning with a period per rfc821.
560 Raises SMTPDataError if there is an unexpected reply to the
561 DATA command; the return value from this method is the final
562 response code received when the all data is sent. If msg
563 is a string, lone '\\r' and '\\n' characters are converted to
564 '\\r\\n' characters. If msg is bytes, it is transmitted as is.
565 """
566 self.putcmd("data")
567 (code, repl) = self.getreply()
568 if self.debuglevel > 0:
569 self._print_debug('data:', (code, repl))
570 if code != 354:
571 raise SMTPDataError(code, repl)
572 else:
573 if isinstance(msg, str):
574 msg = _fix_eols(msg).encode('ascii')
575 q = _quote_periods(msg)
576 if q[-2:] != bCRLF:
577 q = q + bCRLF
578 q = q + b"." + bCRLF
579 self.send(q)
580 (code, msg) = self.getreply()
581 if self.debuglevel > 0:
582 self._print_debug('data:', (code, msg))
583 return (code, msg)
584
585 def verify(self, address):
586 """SMTP 'verify' command -- checks for address validity."""

Callers 1

sendmailMethod · 0.95

Calls 8

putcmdMethod · 0.95
getreplyMethod · 0.95
_print_debugMethod · 0.95
sendMethod · 0.95
SMTPDataErrorClass · 0.85
_fix_eolsFunction · 0.85
_quote_periodsFunction · 0.85
encodeMethod · 0.45

Tested by

no test coverage detected