type command letters to process it the command lists (printsthe contents of given mail numberherewe just used it to list two emails we sent in the preceding sectionwith the smtpmail scriptand interactively pymail also lets us get command helpdelete messages (deletions actually occur at the server on exit from the program)and save messages away in local text file whose name is listed in the mailconfig module we saw earlier[pymailaction(ildsmq?available commandsi index display nlist all messages (or just message nd nmark all messages for deletion (or just message ns nsave all messages to file (or just message nm compose and send new mail message quit pymail display this help text [pymailaction(ildsmq? [pymailaction(ildsmq? nowlet' pick the mail compose option--pymail inputs the mail partsbuilds mail text with emailand ships it off with smtplib you can separate recipients with commaand use either simple "addror full "name address pairs if desired because the mail is sent by smtpyou can use arbitrary from addresses herebut againyou generally shouldn' do that (unlessof courseyou're trying to come up with interesting examples for book)[pymailaction(ildsmq? fromcardinal@hotmail com topp @learning-python com subjamong our weapons are these type message textend with line=nobody expects the spanish inquisition[pymailaction(ildsmq? to be deleted[ delete? connecting '+ok deleting messages from server bye as mentioneddeletions really happen only on exit when we quit pymail with the commandit tells us which messages are queued for deletionand verifies the request once verifiedpymail finally contacts the mail server again and issues pop calls to delete the selected mail messages because deletions change message numbers in the server' inboxpostponing deletion until exit simplifies the handling of already loaded email (we'll improve on this in the pymailgui client of the next client-side scripting