protected void addressMessage(final Message msg) throws MessagingException {
if (from != null) {
InternetAddress internetAddress = getAddress(from);
if(this.nickName!=null) {
try{
internetAddress.setPersonal(this.nickName, this.getEncoding());
}catch (UnsupportedEncodingException e1){
errorHandler.error("Could not parse address ["+internetAddress+"].", e1,
ErrorCode.ADDRESS_PARSE_FAILURE);
}
}
msg.setFrom(internetAddress);
} else {
msg.setFrom();
}
//Add ReplyTo addresses if defined.
if (replyTo != null && replyTo.length() > 0) {
msg.setReplyTo(parseAddress(replyTo));
}
if (to != null && to.length() > 0) {
msg.setRecipients(Message.RecipientType.TO, parseAddress(to));
}
//Add CC receipients if defined.
if (cc != null && cc.length() > 0) {
msg.setRecipients(Message.RecipientType.CC, parseAddress(cc));
}
//Add BCC receipients if defined.
if (bcc != null && bcc.length() > 0) {
msg.setRecipients(Message.RecipientType.BCC, parseAddress(bcc));
}
}
EmailDailyRollingFileAppender.java 文件源码
java
阅读 28
收藏 0
点赞 0
评论 0
项目:log4j-collector
作者:
评论列表
文章目录