Trying to make mail function properly.