Package com.acelet.s

Source Code of com.acelet.s.MailServerData

/* Copyright 1999-2008 Acelet.org. All rights reserved. GPL v2 license */
/** @author Wei Jiang */

package com.acelet.s;

import com.acelet.lib.SendEmail;
import com.acelet.lib.SuperProperties;

public class MailServerData {
  protected static String postmaster = null;
  protected static String alertEmail = null;
  protected static String mailHostname = null;
  protected static String mailHostUserName = null;
  protected static String mailHostPassword = null;
  protected static boolean mailDebug = false;

  static {
    init();
  }

  public static SendEmail getSendEmailObject() {
    return new SendEmail(MailServerData.postmaster, MailServerData.alertEmail,
        MailServerData.mailHostname, MailServerData.mailHostUserName,
        MailServerData.mailHostPassword, MailServerData.mailDebug);
  }

  public static String getMailHostname() {
    return mailHostname;
  }

  public static void init() {
    try {
      SuperProperties superProperties = new SuperProperties();
      MailServerData.postmaster = superProperties.get(SuperProperties.MAIL_POSTMASTER);
      MailServerData.alertEmail = superProperties.get(SuperProperties.MAIL_ALERT);
      MailServerData.mailHostname = superProperties.get(SuperProperties.MAIL_HOSTNAME);
      MailServerData.mailHostUserName = superProperties.get(SuperProperties.MAIL_HOST_USER_NAME);
      MailServerData.mailHostPassword = superProperties.get(SuperProperties.MAIL_HOST_PASSWORD);
      MailServerData.mailDebug = superProperties.getBoolean(SuperProperties.MAIL_DEBUG, false);

      if (MailServerData.mailHostUserName != null) {
        MailServerData.mailHostUserName = MailServerData.mailHostUserName.trim();
        if (MailServerData.mailHostUserName.length() == 0)
          MailServerData.mailHostUserName = null;
      }
    } catch (Exception exception) {
      exception.printStackTrace();
    }
  }
}
TOP

Related Classes of com.acelet.s.MailServerData

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.