You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
705 B
30 lines
705 B
import smtplib
|
|
import email.message
|
|
|
|
def enviar_email():
|
|
corpo_email = """
|
|
<p>Olá Mundo!</p>
|
|
<p>Testes com Python</p>
|
|
"""
|
|
|
|
msg = email.message.Message()
|
|
msg['Subject'] = "Testes com Python"
|
|
msg['From'] = 'adriano.baumart@aspin.inf.br'
|
|
msg['To'] = "tcheweb@gmail.com; adriano@baumart.com.br"
|
|
password = 'As1453!@'
|
|
msg.add_header('Content-Type', 'text/html')
|
|
msg.set_payload(corpo_email)
|
|
|
|
s = smtplib.SMTP('email-ssl.com.br: 587')
|
|
s.starttls()
|
|
# Login Credentials for sending the mail
|
|
s.login(msg['From'], password)
|
|
s.sendmail(msg['From'], [msg['To']], msg.as_string().encode('utf-8'))
|
|
print('Email enviado')
|
|
|
|
|
|
# In[ ]:
|
|
|
|
|
|
enviar_email()
|
|
|
|
|