Open Benjamin-Loison opened 3 weeks ago
s.sendmail
returns {}
.
The Stack Overflow answer 64890 solves this issue for my current needs it seems.
I verified with this method that can specify another email than the actual one for From for both Orange and Gmail.
Is:
conn.set_debuglevel(False)
useless?
help(conn.set_debuglevel)
help(conn)
help(conn)
grep -in 'debug' output.txt
conn = SMTP(SMTP_SERVER)
print(f'{conn.debuglevel=}')
conn.debuglevel=0
so it seems pretty useless.
try:
print('Try')
1 / 0
except:
print('Except')
finally:
print('Finally')
Try
Except
Finally
Can't send multiple emails without SMTP(SMTP_SERVER)
and .login(USERNAME, PASSWORD)
?
I verified this script with my school email address for the sender and @orange.fr
and @protonmail.com
recipients.
The Stack Overflow answer 6270987
Python script:
```python # Import smtplib for the actual sending function import smtplib # Import the email modules we'll need from email.mime.text import MIMEText msg = MIMEText('My body') msg['Subject'] = 'My subject' FROM = 'algorithm@lemnoslife.com' msg['From'] = FROM TO = 'benjamin.loison@CENSORED.fr' msg['To'] = TO # Send the message via our own SMTP server, but don't include the # envelope header. s = smtplib.SMTP('localhost') s.sendmail(FROM, [TO], msg.as_string()) s.quit() ```On my Linux Mint 22 Cinnamon Framework 13:
``` Traceback (most recent call last): File "On LemnosLife VPS no error or output is raised but do not receive an email on my personal email in a few minutes, even in spam.