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

Method ehlo_or_helo_if_needed

Lib/smtplib.py:606–621  ·  view source on GitHub ↗

Call self.ehlo() and/or self.helo() if needed. If there has been no previous EHLO or HELO command this session, this method tries ESMTP EHLO first. This method may raise the following exceptions: SMTPHeloError The server didn't reply properly to

(self)

Source from the content-addressed store, hash-verified

604 # some useful methods
605
606 def ehlo_or_helo_if_needed(self):
607 """Call self.ehlo() and/or self.helo() if needed.
608
609 If there has been no previous EHLO or HELO command this session, this
610 method tries ESMTP EHLO first.
611
612 This method may raise the following exceptions:
613
614 SMTPHeloError The server didn't reply properly to
615 the helo greeting.
616 """
617 if self.helo_resp is None and self.ehlo_resp is None:
618 if not (200 <= self.ehlo()[0] <= 299):
619 (code, resp) = self.helo()
620 if not (200 <= code <= 299):
621 raise SMTPHeloError(code, resp)
622
623 def auth(self, mechanism, authobject, *, initial_response_ok=True):
624 """Authentication command - requires response processing.

Callers 5

loginMethod · 0.95
starttlsMethod · 0.95
sendmailMethod · 0.95
send_messageMethod · 0.95

Calls 3

ehloMethod · 0.95
heloMethod · 0.95
SMTPHeloErrorClass · 0.85

Tested by 1