private String createMailToLink ( String to , String bcc , String cc , String subject , String body ) { Validate . notNull ( to , "You must define a to-address" ) ; final StringBuilder urlBuilder = new StringBuilder ( "mailto:" ) ; addEncodedValue ( urlBuilder , "to" , to ) ; if ( bcc != null || cc != null || subject != null || body != null ) { urlBuilder . append ( ' ' ) ; } addEncodedValue ( urlBuilder , "bcc" , bcc ) ; addEncodedValue ( urlBuilder , "cc" , cc ) ; addEncodedValue ( urlBuilder , "subject" , subject ) ; if ( body != null ) { addEncodedValue ( urlBuilder , "body" , body . replace ( "$NL$" , "\r\n" ) ) ; } return urlBuilder . toString ( ) ; }
Creates the mailto - link .