mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2024-11-26 02:57:04 +00:00
17 lines
365 B
Python
17 lines
365 B
Python
import smtplib, sys, os
|
|
|
|
fromaddr = "testuser@" + os.environ.get("DOMAIN", "testdomain.com")
|
|
|
|
msg = """From: %s
|
|
To: %s
|
|
|
|
This is a test message.""" % (fromaddr, sys.argv[1])
|
|
|
|
server = smtplib.SMTP(os.environ["INSTANCE_IP"], 587)
|
|
server.set_debuglevel(1)
|
|
server.starttls()
|
|
server.login(fromaddr, "testpw")
|
|
server.sendmail(fromaddr, [sys.argv[1]], msg)
|
|
server.quit()
|
|
|