Cleaned up code. Added "\r\n" after we submit a message so the imap server