public static EmailMessage addToRecipientToEmailMessage ( final String recipientEmail , final String recipientPersonal , final String recipientCharset , final EmailMessage emailMessage ) throws UnsupportedEncodingException , MessagingException { // Try to create the recipient Address Address recipientAddress = EmailExtensions . newAddress ( recipientEmail , recipientPersonal , recipientCharset ) ; // Set recipient if ( null != recipientAddress ) { emailMessage . addTo ( recipientAddress ) ; } else { emailMessage . setRecipients ( Message . RecipientType . TO , recipientEmail ) ; } return emailMessage ; }
Adds a to recipient to the email message .