// When remove an mail, this functions only accept array in param, overthere converting this param ...
 if (!is_array($mailid)) {
     $mailids = array($mailid);
 } else {
     $mailids = $mailid;
 }
 // Print action in case . . .
 switch ($action) {
     case 'removemail':
         // Fix bug
         $options->folderoldid = $folderoldid;
         $success = true;
         foreach ($mailids as $mail) {
             $email = new eMail();
             $email->set_email($mail);
             $success &= $email->remove($USER->id, $courseid, $folder->id, true);
         }
         if ($success) {
             notify(get_string('removeok', 'block_email_list'), 'notifysuccess');
         } else {
             notify(get_string('removefail', 'block_email_list'));
         }
         break;
     case 'toread':
         $success = true;
         foreach ($mailids as $mail) {
             $email = new eMail();
             $email->set_email($mail);
             $success &= $email->mark2read($USER->id, $courseid, true);
         }
         if ($success) {