Nov-28-2019, 04:05 AM
import smtplib from email.mime.text import MIMEText with open(textfile) as fp: msg = MIMEText(fp.read()) msg['Subject'] = 'something' msg['From'] = me msg['To'] = you s = smtplib.SMTP('localhost') s.send_message(msg) s.quit()I want to send an email to a gmail account from my computer.
I replace 'localhost' with gmail.com but nothing happens.
What am I doing wrong?
How can I send an email to gmail without logging in to some smtp relay system. I just want to send am email from my computer/python by directly tapping to the gmail smtp listener daemon etc. No accounts, no servers. Is that possible? Please advise.