foreach($_POST['mailId'] as $mailId){
//her bir elementin icin islem
}