MCPcopy Index your code
hub / github.com/python/cpython / mail

Method mail

Lib/smtplib.py:534–553  ·  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 the serv

(self, sender, options=())

Source from the content-addressed store, hash-verified

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

Calls 8

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