in the prior version of the smtpmail script of example - simple date format was used for the date email header that didn' quite follow the smtp date formatting standardimport time time asctime('wed may : : most servers don' care and will let any sort of date text appear in date header linesor even add one if needed clients are often similarly forgivingbut not alwaysone of my isp webmail programs shows dates correctly anyhowbut another leaves such illformed dates blank in mail displays if you want to be more in line with the standardyou could format the date header with code like this (the result can be parsed with standard tools such as the time strptime call)import time gmt time gmtime(time time()fmt '% % % % % :% :% gmtstr time strftime(fmtgmthdr 'datestr print(hdrthe hdr variable' value looks like this when this code is rundatewed may : : gmt the time strftime call allows arbitrary date and time formattingtime asctime is just one standard format better yetdo what smtpmail does now--in the newer email package (described in this an email utils call can be used to properly format date and time automatically the smtpmail script uses the first of the following format alternativesimport email utils email utils formatdate('wed may : : - email utils formatdate(localtime=true'wed may : : - email utils formatdate(usegmt=true'wed may : : gmtsee the pymail and mailtools examples in this for additional usage examplesthe latter is reused by the larger pymailgui and pymailcgi email clients later in this book sending email at the interactive prompt so where are we in the internet abstraction model nowwith all this email fetching and sending going onit' easy to lose the forest for the trees keep in mind that because mail is transferred over sockets (remember sockets?)they are at the root of all this activity all email read and written ultimately consists of formatted bytes shipped over smtpsending email