mirror of
https://github.com/Mailu/Mailu.git
synced 2024-12-12 10:45:38 +02:00
Add a very simple test script for sending mails
This commit is contained in:
parent
697caaab81
commit
82140baa69
17
tests/smtp.py
Normal file
17
tests/smtp.py
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import smtplib
|
||||||
|
import sys
|
||||||
|
from email import mime
|
||||||
|
|
||||||
|
from email.mime.image import MIMEImage
|
||||||
|
from email.mime.multipart import MIMEMultipart
|
||||||
|
|
||||||
|
msg = mime.multipart.MIMEMultipart()
|
||||||
|
msg['Subject'] = 'Test email'
|
||||||
|
msg['From'] = sys.argv[1]
|
||||||
|
msg['To'] = sys.argv[2]
|
||||||
|
msg.preamble = 'Test email'
|
||||||
|
|
||||||
|
s = smtplib.SMTP('localhost')
|
||||||
|
s.set_debuglevel(1)
|
||||||
|
s.send_message(msg)
|
||||||
|
s.quit()
|
Loading…
Reference in New Issue
Block a user