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('firstname.lastname@example.org', 'bobspassword') smtp.to('email@example.com') smtp.write("From: Bob <firstname.lastname@example.org>\n") smtp.write("To: Alice <email@example.com>\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