Beyler programi yazdim ama gizli email nasil gönderebilirim?
import smtplib
from email.mime.text import MIMEText
from email.utils import *
email_sender = 'noreply%%@gmail.com'
email_receiver = 'example%%%@gmail.com'
subject = 'Python!'
msg = MIMEText('This is the body of the message.')
msg['To'] = formataddr(('Recipient', 'example%%%@gmail.com'))
msg['From'] = formataddr(('Author', '[email protected]'))
msg['Subject'] = 'Simple test message'
connection = smtplib.SMTP('smtp.gmail.com', 587)
connection.starttls()
connection.login(email_sender, 'password')
connection.sendmail(msg['From'], email_receiver, msg.as_string())
connection.quit()
import smtplib
from email.mime.text import MIMEText
from email.utils import *
email_sender = 'noreply%%@gmail.com'
email_receiver = 'example%%%@gmail.com'
subject = 'Python!'
msg = MIMEText('This is the body of the message.')
msg['To'] = formataddr(('Recipient', 'example%%%@gmail.com'))
msg['From'] = formataddr(('Author', '[email protected]'))
msg['Subject'] = 'Simple test message'
connection = smtplib.SMTP('smtp.gmail.com', 587)
connection.starttls()
connection.login(email_sender, 'password')
connection.sendmail(msg['From'], email_receiver, msg.as_string())
connection.quit()