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

Method putcmd

Lib/smtplib.py:374–385  ·  view source on GitHub ↗

Send a command to the server.

(self, cmd, args="")

Source from the content-addressed store, hash-verified

372 raise SMTPServerDisconnected('please run connect() first')
373
374 def putcmd(self, cmd, args=""):
375 """Send a command to the server."""
376 if args == "":
377 s = cmd
378 else:
379 s = f'{cmd} {args}'
380 if '\r' in s or '\n' in s:
381 s = s.replace('\n', '\\n').replace('\r', '\\r')
382 raise ValueError(
383 f'command and arguments contain prohibited newline characters: {s}'
384 )
385 self.send(f'{s}{CRLF}')
386
387 def getreply(self):
388 """Get a reply from the server.

Callers 11

docmdMethod · 0.95
heloMethod · 0.95
ehloMethod · 0.95
helpMethod · 0.95
mailMethod · 0.95
rcptMethod · 0.95
dataMethod · 0.95
verifyMethod · 0.95
expnMethod · 0.95

Calls 2

sendMethod · 0.95
replaceMethod · 0.45