You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File "C:/Users/user/projects/sandbox/mailertest.py", line 514, in run
await smtp_client.send_message(msg)
File "C:\Anaconda\envs\sandbox\lib\site-packages\aiosmtplib\smtp.py", line 299, in send_message
timeout=timeout,
File "C:\Anaconda\envs\sandbox\lib\site-packages\aiosmtplib\smtp.py", line 174, in sendmail
await self.rset(timeout=timeout)
File "C:\Anaconda\envs\sandbox\lib\site-packages\aiosmtplib\esmtp.py", line 128, in rset
response = await self.execute_command(b"RSET", timeout=timeout)
File "C:\Anaconda\envs\sandbox\lib\site-packages\aiosmtplib\connection.py", line 420, in execute_command
response = await self.protocol.execute_command(*args, timeout=timeout)
File "C:\Anaconda\envs\sandbox\lib\site-packages\aiosmtplib\protocol.py", line 291, in execute_command
response = await self.read_response(timeout=timeout)
File "C:\Anaconda\envs\sandbox\lib\site-packages\aiosmtplib\protocol.py", line 259, in read_response
self._response_waiter, timeout
File "C:\Anaconda\envs\sandbox\lib\asyncio\tasks.py", line 442, in wait_for
return fut.result()
While, obviously, you should not forget to authenticate to the server, if it requires you to, throwing CancelledError doesn't seem to me as the correct behavior. I would expect to get some sort of SMTPException instead. In fact, while testing, I got SMTPSenderRefused on multiple occasions, but most of the time CancelledError is raised.
The text was updated successfully, but these errors were encountered:
Agree, that's confusing. The connection is being lost, but CancelledError isn't helpful there. Please try the current main branch (if you can) and see if the issue persists for you; it should now raise SMTPSenderRefused, since that's the point where the server raised an error.
If we try to
send_message(msg)
through the server, which requireslogin()
, without logging in, a CancelledError will be thrown:Traceback:
While, obviously, you should not forget to authenticate to the server, if it requires you to, throwing
CancelledError
doesn't seem to me as the correct behavior. I would expect to get some sort ofSMTPException
instead. In fact, while testing, I gotSMTPSenderRefused
on multiple occasions, but most of the timeCancelledError
is raised.The text was updated successfully, but these errors were encountered: