“Python SMTP Sendmail” Code-Antworten

E -Mail -Authentifizierung 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

Ähnliche Antworten wie “Python SMTP Sendmail”

Fragen ähnlich wie “Python SMTP Sendmail”

Weitere verwandte Antworten zu “Python SMTP Sendmail” auf Python

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen