def smtp_login(email, passwd, connectfun):
 global _email_from, _smtp, _smtp_connect
 def connect():
  smtp = connectfun()
  smtp.login(email, passwd)
  return smtp
 _email_from = email
 _smtp_connect = connect
 _smtp = _smtp_connect()

def smtp_login ( email , passwd , connectfun ) : global _email_from , _smtp , _smtp_connect def connect ( ) : smtp = connectfun ( ) smtp . login ( email , passwd ) return smtp _email_from = email _smtp_connect = connect _smtp = _smtp_connect ( )
logs into an smtp mail server .