switched location of mail function details