you can also download all of them at once with downloadallattachments(by defaultezgmail saves attachments to the current working directorybut you can pass an additional downloadfolder keyword argument to downloadattachment(and downloadallattachments(as well for exampleimport ezgmail threads ezgmail search('vacation photos'threads[ messages[ attachments ['tulips jpg''canal jpg''bicycles jpg'threads[ messages[ downloadattachment('tulips jpg'threads[ messages[ downloadallattachments(downloadfolder='vacat ion '['tulips jpg''canal jpg''bicycles jpg'if file already exists with the attachment' filenamethe downloaded attachment will automatically overwrite it ezgmail contains additional featuresand you can find the full documentation at smtp much as http is the protocol used by computers to send web pages across the internetsimple mail transfer protocol (smtpis the protocol used for sending email smtp dictates how email messages should be formattedencryptedand relayed between mail servers and all the other details that your computer handles after you click send you don' need to know these technical detailsthoughbecause python' smtplib module simplifies them into few functions smtp just deals with sending emails to others different protocolcalled imapdeals with retrieving emails sent to you and is described in "imapon page in addition to smtp and imapmost web-based email providers today have other security measures in place to protect against spamphishingand other malicious email usage these measures prevent python scripts from logging in to an email account with the smtplib and imapclient modules howevermany of these services have apis and specific python modules that allow scripts to access them this covers gmail' module for othersyou'll need to consult their online documentation sending email you may be familiar with sending emails from outlook or thunderbird or through website such as gmail or yahoo mail unfortunatelypython doesn' offer you nice graphical user interface like those services insteadyou call functions to perform each major step of smtpas shown in the following interactive shell example