“python smtp sendmail” Réponses codées

Authentification par e-mail Python

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

Réponses similaires à “python smtp sendmail”

Questions similaires à “python smtp sendmail”

Plus de réponses similaires à “python smtp sendmail” dans Python

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code