little function to readEmails from imap and store them in a mysql database