“python smtp sendmail” Código de respuesta

Python de autenticación por correo electrónico

import smtplib

server = smtplib.SMTP_SSL('smtp.gmail.com', 465)
server.login("your username", "your password")
server.sendmail(
  "[email protected]", 
  "[email protected]", 
  "this message is from python")
server.quit()
Awful Addax

python smtp sendmail

#!/usr/bin/env python

import smtplib
from email.mime.text import MIMEText

sender = '[email protected]'
receivers = ['[email protected]']


port = 1025
msg = MIMEText('This is test mail')

msg['Subject'] = 'Test mail'
msg['From'] = '[email protected]'
msg['To'] = '[email protected]'

with smtplib.SMTP('localhost', port) as server:
    
    # server.login('username', 'password')
    server.sendmail(sender, receivers, msg.as_string())
    print("Successfully sent email")
Active Programmer

Respuestas similares a “python smtp sendmail”

Preguntas similares a “python smtp sendmail”

Más respuestas relacionadas con “python smtp sendmail” en Python

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código