Update mail.rb

Added comments explaining functions of the script.