You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
410 B

#!/usr/bin/env python3
import smtplib, sys
if len(sys.argv) < 3:
print("Usage: tests/ host email.from")
host, toaddr, fromaddr = sys.argv[1:4]
msg = """From: %s
To: %s
Subject: SMTP server test
This is a test message.""" % (fromaddr, toaddr)
server = smtplib.SMTP(host, 25)
server.sendmail(fromaddr, [toaddr], msg)