public static GWTEmailAddress[] convertAddress( Address[] addresses ) throws MessagingException {
if ( addresses != null ) {
GWTEmailAddress[] gwtAdresses = new GWTEmailAddress[addresses.length];
for (int i = 0; i < addresses.length; i++) {
GWTEmailAddress gwtAddress = new GWTEmailAddress();
gwtAddress.setInternetAddress( MessageUtils.getMailAdressString( addresses[i],
AddressStringType.COMPLETE ) );
gwtAddress.setName( MessageUtils.getMailAdressString( addresses[i], AddressStringType.PERSONAL_ONLY ) );
gwtAddress.setEmail( MessageUtils.getMailAdressString( addresses[i], AddressStringType.EMAIL ) );
gwtAdresses[i] = gwtAddress;
}
return gwtAdresses;
}