added support to multiple type with unnion for mail