Last active
November 21, 2015 19:31
-
-
Save 2624789/4234fd8299eaaa4f455d to your computer and use it in GitHub Desktop.
Enviar correo sin asunto utilizando python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import smtplib | |
# Creamos la conexión con el servidor | |
sesion_smtp = smtplib.SMTP('smtp.gmail.com', 587) | |
# Ciframos la conexión | |
sesion_smtp.starttls() | |
# Iniciamos sesión en el servidor | |
sesion_smtp.login('[email protected]','una contraseña segura') | |
# Creamos el mensaje | |
mensaje = 'Enviando correos desde la Raspberry' | |
# Enviamos el mensaje | |
sesion_smtp.sendmail('[email protected]', '[email protected]', mensaje) | |
# Cerramos la conexión | |
sesion_smtp.quit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment