| | |
| | | */ |
| | | public EMailMessage(String sender, String recipient, String subject) |
| | | { |
| | | |
| | | this.sender = sender; |
| | | this.subject = subject; |
| | | |
| | |
| | | public EMailMessage(String sender, ArrayList<String> recipients, |
| | | String subject) |
| | | { |
| | | |
| | | this.sender = sender; |
| | | this.recipients = recipients; |
| | | this.subject = subject; |
| | |
| | | */ |
| | | public String getSender() |
| | | { |
| | | |
| | | return sender; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setSender(String sender) |
| | | { |
| | | |
| | | this.sender = sender; |
| | | } |
| | | |
| | |
| | | */ |
| | | public ArrayList<String> getRecipients() |
| | | { |
| | | |
| | | return recipients; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setRecipients(ArrayList<String> recipients) |
| | | { |
| | | |
| | | this.recipients = recipients; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void addRecipient(String recipient) |
| | | { |
| | | |
| | | recipients.add(recipient); |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getSubject() |
| | | { |
| | | |
| | | return subject; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setSubject(String subject) |
| | | { |
| | | |
| | | this.subject = subject; |
| | | } |
| | | |
| | |
| | | */ |
| | | public StringBuilder getBody() |
| | | { |
| | | |
| | | return body; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setBody(StringBuilder body) |
| | | { |
| | | |
| | | this.body = body; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setBody(String bodyString) |
| | | { |
| | | |
| | | body = new StringBuilder(bodyString); |
| | | } |
| | | |
| | |
| | | */ |
| | | public void appendToBody(String text) |
| | | { |
| | | |
| | | body.append(text); |
| | | } |
| | | |
| | |
| | | */ |
| | | public LinkedList<MimeBodyPart> getAttachments() |
| | | { |
| | | |
| | | return attachments; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void addAttachment(MimeBodyPart attachment) |
| | | { |
| | | |
| | | attachments.add(attachment); |
| | | } |
| | | |
| | |
| | | public void addAttachment(String attachmentText) |
| | | throws MessagingException |
| | | { |
| | | |
| | | MimeBodyPart attachment = new MimeBodyPart(); |
| | | attachment.setText(attachmentText); |
| | | attachments.add(attachment); |
| | |
| | | public void addAttachment(File attachmentFile) |
| | | throws MessagingException |
| | | { |
| | | |
| | | MimeBodyPart attachment = new MimeBodyPart(); |
| | | |
| | | FileDataSource dataSource = new FileDataSource(attachmentFile); |
| | |
| | | public void send() |
| | | throws MessagingException |
| | | { |
| | | |
| | | |
| | | // Get information about the available mail servers that we can use. |
| | | MessagingException sendException = null; |
| | | for (Properties props : DirectoryServer.getMailServerPropertySets()) |