private void setHeaders ( final Email emailWithData , final MimeMessage msgToSet ) throws MessagingException { final Map < String , String > headers = emailWithData . headers ( ) ; if ( headers != null ) { for ( final Map . Entry < String , String > entry : headers . entrySet ( ) ) { msgToSet . setHeader ( entry . getKey ( ) , entry . getValue ( ) ) ; } } }
Sets headers in msgToSet with headers from emailWithData .