The API was designed in a way so that it can accommodate sending long emails in a memory constrained system.
There is no pre-defined options for email headers(from/to/subject) so you have to draft up your own
Code: Select all
import umail smtp = umail.SMTP('smtp.gmail.com', 465, ssl=True) # Gmail's SSL port smtp.login('email@example.com', 'bobspassword') smtp.to('firstname.lastname@example.org') smtp.write("From: Bob <email@example.com>\n") smtp.write("To: Alice <firstname.lastname@example.org>\n") smtp.write("Subject: Poem\n") smtp.write("Roses are red.\n") smtp.write("Violets are blue.\n") smtp.write("...\n") smtp.send() smtp.quit()
UPDATE 1: Changed argument name 'email' to 'username' as brought up by @SpotlightKid