I am new in Raspberry Pi and I am trying to send mails without using SMTP. I had used SMTP before and it worked perfectly fine. But recently the same code is not working, though it compiles without any error. I have added the error message below. I want to know are there any ways besides SMTP?
SMTP, or Simple Mail Transport Protocol is the mail delivery mechanism in use currently on the Internet.
You can't send email without using SMTP in one way or another, either directly, or via a script or program that accesses a tool (for example an API or email-based website) that ties directly with SMTP on its back end.
You don't say what OS or list any code, but do tag
ssmtp which is deprecated in Buster and hasn't been updated in years.
There are replacements. I use
msmtp (although not Python). See https://raspberrypi.stackexchange.com/a/100704/8697