def send(self, *, from_addr, to_addrs, subject, body):
request = self._session.post(
f'https://api.mailgun.net/v3/{self._domain}/messages',
auth=aiohttp.BasicAuth("api", self._api_key),
data={"from": from_addr,
"to": to_addrs,
"subject": subject,
"text": body,
})
async with request as response:
response.raise_for_status()
评论列表
文章目录