protected final void render(Part mailPart, String fileName, DataSource source) throws MailBuilderException {
try {
mailPart.setDataHandler(new DataHandler(source));
if (isEmpty(fileName)) {
throw new MailBuilderException("No fileName was specified with " + this);
}
// ȷ��fileName�в�����/��\
fileName = fileName.replace('\\', '/');
fileName = StringUtil.defaultIfEmpty(StringUtil.substringAfterLast(fileName, "/"), fileName);
mailPart.setFileName(MailUtil.encodeHeader(fileName, getMailBuilder().getCharacterEncoding()));
} catch (MessagingException e) {
throw new MailBuilderException("Failed to add attachment to the mail", e);
} catch (UnsupportedEncodingException e) {
throw new MailBuilderException("Failed to add attachment to the mail", e);
}
}