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

Method mail

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

SMTP 'mail' command -- begins mail xfer session. This method may raise the following exceptions: SMTPNotSupportedError The options parameter includes 'SMTPUTF8' but the SMTPUTF8 extension is not supported by th

(self, sender, options=())

Source from the content-addressed store, hash-verified

525 return self.docmd("noop")
526
527 def mail(self, sender, options=()):
528 """SMTP 'mail' command -- begins mail xfer session.
529
530 This method may raise the following exceptions:
531
532 SMTPNotSupportedError The options parameter includes 'SMTPUTF8'
533 but the SMTPUTF8 extension is not supported by
534 the server.
535 """
536 optionlist = ''
537 if options and self.does_esmtp:
538 if any(x.lower()=='smtputf8' for x in options):
539 if self.has_extn('smtputf8'):
540 self.command_encoding = 'utf-8'
541 else:
542 raise SMTPNotSupportedError(
543 'SMTPUTF8 not supported by server')
544 optionlist = ' ' + ' '.join(options)
545 self.putcmd("mail", "FROM:%s%s" % (quoteaddr(sender), optionlist))
546 return self.getreply()
547
548 def rcpt(self, recip, options=()):
549 """SMTP 'rcpt' command -- indicates 1 recipient for this mail."""

Callers 1

sendmailMethod · 0.95

Calls 8

has_extnMethod · 0.95
putcmdMethod · 0.95
getreplyMethod · 0.95
quoteaddrFunction · 0.85
anyFunction · 0.70
lowerMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected