private static class SendMailHelper.MailSender extends Object implements Runnable
Modifier and Type | Field and Description |
---|---|
private Collection<File> |
_attachments |
private List<String> |
_bcc |
private List<String> |
_cc |
private boolean |
_deliveryReceipt |
private String |
_host |
private String |
_htmlBody |
private Logger |
_logger |
private String |
_password |
private long |
_port |
private boolean |
_readReceipt |
private String |
_recipient |
private String |
_securityProtocol |
private String |
_sender |
private String |
_subject |
private String |
_textBody |
private String |
_user |
Constructor and Description |
---|
MailSender(Logger logger,
String subject,
String htmlBody,
String textBody,
Collection<File> attachments,
String recipient,
String sender,
List<String> cc,
List<String> bcc,
boolean deliveryReceipt,
boolean readReceipt,
String host,
long port,
String securityProtocol,
String user,
String password)
Initialize the mail sender with email parameters
|
private Collection<File> _attachments
private String _recipient
private boolean _deliveryReceipt
private boolean _readReceipt
private long _port
private String _securityProtocol
public MailSender(Logger logger, String subject, String htmlBody, String textBody, Collection<File> attachments, String recipient, String sender, List<String> cc, List<String> bcc, boolean deliveryReceipt, boolean readReceipt, String host, long port, String securityProtocol, String user, String password)
logger
- The loggersubject
- The mail subjecthtmlBody
- The HTML mail body. Can be null.textBody
- The text mail body. Can be null.attachments
- the file attachments. Can be null.recipient
- The recipient addresssender
- The sender address. Can be null when called by MailChecker.cc
- Carbon copy address list. Can be null.bcc
- Blind carbon copy address list. Can be null.deliveryReceipt
- true to request that the receiving mail server send a notification when the mail is received.readReceipt
- true to request that the receiving mail client send a notification when the person opens the mail.host
- The server mail host. Can be null when called by MailChecker.securityProtocol
- the security protocol to use when transporting the emailport
- The server portuser
- The user namepassword
- The user passwordpublic void sendMail() throws javax.mail.MessagingException, IOException
javax.mail.MessagingException
IOException