change mail to localmail
This commit is contained in:
24
mail.py
24
mail.py
@@ -1,19 +1,13 @@
|
||||
import smtplib, ssl
|
||||
import smtplib
|
||||
|
||||
port = 465 # For SSL
|
||||
password = "mailR3L4Y"
|
||||
port = 25
|
||||
|
||||
# Create a secure SSL context
|
||||
context = ssl.create_default_context()
|
||||
server=smtplib.SMTP("localhost", port)
|
||||
sender_email = "pope@home.kawomi.com"
|
||||
receiver_email = "pope@kawomi.com"
|
||||
message = """\
|
||||
Subject: Hi there
|
||||
|
||||
with smtplib.SMTP_SSL("kawomi.com", port, context=context) as server:
|
||||
server.login("pope@kawomi.com", password)
|
||||
This message is sent from Python."""
|
||||
|
||||
sender_email = "pope@kawomi.com"
|
||||
receiver_email = "j.tretter@gmail.com"
|
||||
message = """\
|
||||
Subject: Hi there
|
||||
|
||||
This message is sent from Python."""
|
||||
|
||||
server.sendmail(sender_email, receiver_email, message)
|
||||
server.sendmail(sender_email, receiver_email, message)
|
||||
|
||||
Reference in New Issue
Block a user