for(Id id: mapname.keyset()){ Set<String> stringset= mapname.get(id); for(String a: stringset){ sendMail(a); }