BrightSide Workbench Full Report + Source Code
org.turro.mail.pool.MailQueueItem Class Reference

Public Member Functions

 MailQueueItem (MailMessage mail, Consumer onFinish)
 
void send ()
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 35 of file MailQueueItem.java.

Constructor & Destructor Documentation

◆ MailQueueItem()

org.turro.mail.pool.MailQueueItem.MailQueueItem ( MailMessage  mail,
Consumer  onFinish 
)

Definition at line 40 of file MailQueueItem.java.

40  {
41  this.mail = mail;
42  this.onFinish = onFinish;
43  }

Member Function Documentation

◆ send()

void org.turro.mail.pool.MailQueueItem.send ( )

Definition at line 45 of file MailQueueItem.java.

45  {
46  if(mail == null) return;
47  try {
48  mail.send();
49  Logger.getLogger(MailQueueItem.class.getName()).log(Level.INFO, "Sent mail from {0} to {1}. Subject: {2}",
50  new Object[]{mail.getEmail().getFromAddress().getAddress(),
51  InternetAddress.toString((InternetAddress[]) mail.getEmail().getToAddresses()
52  .toArray(new InternetAddress[0])), mail.getSubject()});
53  } catch (MalformedURLException | NamingException | EmailException ex) {
54  Logger.getLogger(MailQueueItem.class.getName()).log(Level.SEVERE, ElephantContext.logMsg("Sending"), ex);
55  }
56  if(onFinish != null) {
57  try {
58  onFinish.accept(mail);
59  } catch (Exception ex) {
60  Logger.getLogger(MailQueueItem.class.getName()).log(Level.SEVERE, ElephantContext.logMsg("onFinish"), ex);
61  }
62  }
63 
64  }
MailQueueItem(MailMessage mail, Consumer onFinish)
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: