| dlog4j.util.mail.MailSender
MailSender | abstract public class MailSender extends Authenticator (Code) | | 邮件发送组件,具体的使用方法参照该类的main方法
author: Liudong |
Method Summary | |
public static MailSender | getHtmlMailSender(String smtpHost, String username, String password) | public static MailSender | getHtmlMailSender(String smtpHost, int smtpPort, String username, String password) | protected PasswordAuthentication | getPasswordAuthentication() | public static MailSender | getTextMailSender(String smtpHost, String username, String password) | public static MailSender | getTextMailSender(String smtpHost, int smtpPort, String username, String password) | public static void | main(String args) | public void | sendMail() | public void | setAttachments(String attachmentName) | abstract public void | setMailContent(String mailContent) | public void | setMailFrom(String mailFrom, String sender) | public void | setMailTo(String[] mailTo, String mailType) | public void | setSendDate(Date sendDate) | public void | setSubject(String mailSubject) |
mailMessage | protected MimeMessage mailMessage(Code) | | |
mailSession | protected Session mailSession(Code) | | |
mailToAddress | protected InternetAddress mailToAddress(Code) | | |
messageBodyPart | protected BodyPart messageBodyPart(Code) | | |
multipart | protected Multipart multipart(Code) | | |
MailSender | protected MailSender(String smtpHost, String username, String password)(Code) | | 构造函数
Parameters: smtpHost - Parameters: username - Parameters: password - |
MailSender | protected MailSender(String smtpHost, int smtpPort, String username, String password)(Code) | | 构造函数
Parameters: smtpHost - Parameters: smtpPort - Parameters: username - Parameters: password - |
getHtmlMailSender | public static MailSender getHtmlMailSender(String smtpHost, String username, String password)(Code) | | 构造一个超文本邮件发送实例
See Also: getHtmlMailSender(String smtpHost, int smtpPort, String username, String password) Parameters: smtpHost - Parameters: username - Parameters: password - |
getHtmlMailSender | public static MailSender getHtmlMailSender(String smtpHost, int smtpPort, String username, String password)(Code) | | 构造一个超文本邮件发送实例
Parameters: smtpHost - SMTP服务器地址 Parameters: smtpPort - SMTP服务器端口 Parameters: username - SMTP邮件发送帐号 Parameters: password - SMTP邮件发送帐号对应的密码 |
getPasswordAuthentication | protected PasswordAuthentication getPasswordAuthentication()(Code) | | 用于实现邮件发送用户验证
See Also: javax.mail.Authenticator.getPasswordAuthentication |
getTextMailSender | public static MailSender getTextMailSender(String smtpHost, String username, String password)(Code) | | 构造一个纯文本邮件发送实例
See Also: getTextMailSender(String smtpHost, int smtpPort, String username, String password) Parameters: smtpHost - Parameters: username - Parameters: password - |
getTextMailSender | public static MailSender getTextMailSender(String smtpHost, int smtpPort, String username, String password)(Code) | | 构造一个纯文本邮件发送实例
Parameters: smtpHost - SMTP服务器地址 Parameters: smtpPort - SMTP服务器端口 Parameters: username - SMTP邮件发送帐号 Parameters: password - SMTP邮件发送帐号对应的密码 |
main | public static void main(String args)(Code) | | 邮件发送测试
Parameters: args - |
sendMail | public void sendMail() throws MessagingException, SendFailedException(Code) | | 开始发送邮件
throws: MessagingException - throws: SendFailedException - |
setAttachments | public void setAttachments(String attachmentName) throws MessagingException(Code) | | 设置邮件发送附件
Parameters: attachmentName - throws: MessagingException - |
setMailContent | abstract public void setMailContent(String mailContent) throws MessagingException(Code) | | 所有子类都需要实现的抽象方法,为了支持不同的邮件类型
Parameters: mailContent - throws: MessagingException - |
setMailTo | public void setMailTo(String[] mailTo, String mailType) throws Exception(Code) | | 设置收件人地址,收件人类型为to,cc,bcc(大小写不限)
Parameters: mailTo - 邮件接收者地址 Parameters: mailType - 值为to,cc,bcc author: Liudong |
setSendDate | public void setSendDate(Date sendDate) throws MessagingException(Code) | | 设置邮件发送日期
Parameters: sendDate - throws: MessagingException - |
setSubject | public void setSubject(String mailSubject) throws MessagingException(Code) | | 设置邮件标题
Parameters: mailSubject - throws: MessagingException - |
|
|