from smtplib import SMTP as Client client = Client("localhost", 8025) r = client.sendmail('a@example.com', ['b@example.com'], """\ From: Anne Person To: Bart Person Subject: A test Message-ID: Hi Bart, this is Anne. """)