on sendview+select+replyview+select+fwd pageheader(kind=kindprint('<form enctype="multipart/form-datamethod=post'end='print('action="%soneditpagesend py">urlrootif mailconfig mysignaturetext '\ % \ % (mailconfig mysignaturetextmessagearea(headerstextsendattachmentwidgets(print(''print(''print(''pagefooter(def errorpage(messagestacktrace=true)pageheader(kind='error'was sys exc_type/exc_value exc_typeexc_valueexc_tb sys exc_info(print('error description'messageprint('python exception'cgi escape(str(exc_type))print('exception details'cgi escape(str(exc_value))if stacktraceprint('exception traceback'import traceback traceback print_tb(exc_tbnonesys stdoutprint(''pagefooter(def confirmationpage(kind)pageheader(kind='confirmation'print('% operation was successfulkindprint('press the link below to return to the main page 'pagefooter(def getfield(formfielddefault='')emulate dictionary get method return (field in form and form[fieldvalueor default def getstandardpopfields(form)""fields can arrive missing or 'or with real value hardcoded in urldefault to mailconfig settings ""return (getfield(form'user'mailconfig popusername)getfield(form'pswd''?')getfield(form'site'mailconfig popservername)def getstandardsmtpfields(form)return getfield(form'site'mailconfig smtpservernamedef runsilent(funcargs)""run function without writing stdout exsuppress print' in imported tools else they go to the client/browser "" the pymailcgi server