Package org.apache.commons.mail

Examples of org.apache.commons.mail.SimpleEmail.send()


    }
        email.setFrom(from, "Wookie Server");
        email.setSubject("Wookie API Key");
        email.setMsg(message);
        email.addTo(to);
        email.send();
  }

}
View Full Code Here


      email.setFrom(from, fromDisplayName);
      email.setSubject(subject);
      email.setCharset("UTF-8");
      email.setMsg(content);

      email.send();
  } catch (Exception e) {
      e.printStackTrace();
      throw new RuntimeException(e.getMessage());
  } // end of catch
    } // end of sendModerationConfirmation
View Full Code Here

      email.setFrom(from, fromDisplayName);
      email.setSubject(subject);
      email.setCharset("UTF-8");
      email.setMsg(content);

      email.send();
  } catch (Exception e) {
      e.printStackTrace();
      throw new RuntimeException(e.getMessage());
  } // end of catch
    } // end of sendActivationMessage
View Full Code Here

      email.setFrom(from, fromDisplayName);
      email.setSubject(subject);
      email.setCharset("UTF-8");
      email.setMsg(content);

      email.send();
  } catch (Exception e) {
      e.printStackTrace();
      throw new RuntimeException(e.getMessage());
  } // end of catch
    } // end of sendLostPasswordMessage
View Full Code Here

    email.setSubject(subject);
    email.setCharset("UTF-8");
    email.setMsg(content);
    email.addTo(addr, displayName);

    email.send();
      } // end of while
  } catch (Exception e) {
      e.printStackTrace();
      throw new RuntimeException(e.getMessage());
  } // end of catch
View Full Code Here

    email.setSubject(subject);
    email.setCharset("UTF-8");
    email.setMsg(content);
    email.addTo(addr, displayName);

    email.send();
      } catch (Exception e) {
    e.printStackTrace();
    throw new RuntimeException(e.getMessage());
      } // end of catch
  } // end of while
View Full Code Here

      email.setFrom(from, fromDisplayName);
      email.setSubject(subject);
      email.setCharset("UTF-8");
      email.setMsg(content);

      email.send();
  } catch (Exception e) {
      e.printStackTrace();
      throw new RuntimeException(e.getMessage());
  } // end of catch
    } // end of sendObsolescenceMessage
View Full Code Here

    SimpleEmail mail = new SimpleEmail();

    setup(mail, to, toName, from, fromName, cc, bcc, bounce, subject);
    mail.setMsg(textContent);
    mail.send();

  }

  private static void setup(final Email mail, final String to, final String toName, final String from, final String fromName, final String cc, final String bcc, final String bounce, final String subject)
    throws EmailException {
View Full Code Here

      if (StringUtils.isNotBlank(configuration.getSmtpUsername()) || StringUtils.isNotBlank(configuration.getSmtpPassword())) {
        email.setAuthentication(configuration.getSmtpUsername(), configuration.getSmtpPassword());
      }
      email.setSocketConnectionTimeout(SOCKET_TIMEOUT);
      email.setSocketTimeout(SOCKET_TIMEOUT);
      email.send();

    } finally {
      Thread.currentThread().setContextClassLoader(classloader);
    }
  }
View Full Code Here

      // typically the case for most modern mail servers.
      email.setStartTLSEnabled(true);
    }
    email.setSocketConnectionTimeout(settings.getConnectionTimeout());
    email.setSocketTimeout(settings.getSocketTimeout());
    email.send();

    if (LOG.isTraceEnabled()) {
      LOG.trace("email sent to " + smtpMessage.getTo());
    }
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.