Skip to content

Instantly share code, notes, and snippets.

@2624789
Last active November 21, 2015 19:31
Show Gist options
  • Select an option

  • Save 2624789/4234fd8299eaaa4f455d to your computer and use it in GitHub Desktop.

Select an option

Save 2624789/4234fd8299eaaa4f455d to your computer and use it in GitHub Desktop.
Enviar correo sin asunto utilizando python
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('rpi.mailer.1@gmail.com','una contraseña segura')
# Creamos el mensaje
mensaje = 'Enviando correos desde la Raspberry'
# Enviamos el mensaje
sesion_smtp.sendmail('rpi.mailer.1@gmail.com', 'destinatario@correo.com', 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