MCPcopy
hub / github.com/scrapy/scrapy / _sendmail

Method _sendmail

scrapy/mail.py:204–219  ·  view source on GitHub ↗
(self, to_addrs: list[str], msg: bytes)

Source from the content-addressed store, hash-verified

202 return failure
203
204 def _sendmail(self, to_addrs: list[str], msg: bytes) -> Deferred[Any]:
205 from twisted.internet import reactor
206
207 msg_io = BytesIO(msg)
208 d: Deferred[Any] = Deferred()
209
210 factory = self._create_sender_factory(to_addrs, msg_io, d)
211
212 if self.smtpssl:
213 reactor.connectSSL(
214 self.smtphost, self.smtpport, factory, ssl.ClientContextFactory()
215 )
216 else:
217 reactor.connectTCP(self.smtphost, self.smtpport, factory)
218
219 return d
220
221 def _create_sender_factory(
222 self, to_addrs: list[str], msg: IO[bytes], d: Deferred[Any]

Callers 1

sendMethod · 0.95

Calls 1

Tested by

no test coverage detected