Added the sendEmail function
Fixed a sendEmail bug
Added a bit of modularity in imap connection