code: def get_email_address(whoami="user"):
      
      if whoami == "user":
          username = getusername()
          domain = getdomainname()
  
          myemail = "{0}@{1}".format(username, domain)
          return myemail
      else:
          fromaddr = "notifier-donotreply@{0}".format(getdomainname())
          return fromaddr
docs: Auto-generate the FROM and TO email address