类 SmtpCfgs

java.lang.Object
com.gdxsoft.easyweb.utils.Mail.SmtpCfgs

public class SmtpCfgs extends Object
  • 构造器详细资料

    • SmtpCfgs

      public SmtpCfgs()
  • 方法详细资料

    • initCfgs

      public static void initCfgs(Document doc)
      Initial smtp cfg
      参数:
      doc -
    • getDkim

      public static DKIMCfg getDkim(String emailOrDomain)
      Return the DKIMCfg according to parameter emailOrDomain
      参数:
      emailOrDomain - Email or Domain
      返回:
      DKIMCfg or null
    • getSmtpCfg

      public static SmtpCfg getSmtpCfg(SendMail sm)
      Get a SMTP configuration from the SendMail
      参数:
      sm - the SendMail
      返回:
      the SMTP configuration
    • getSmtpCfg

      public static SmtpCfg getSmtpCfg(javax.mail.internet.MimeMessage msg)
      Get a SMTP configuration from the message
      参数:
      msg - the message
      返回:
      the SMTP configuration
    • getSmtpCfg

      public static SmtpCfg getSmtpCfg(String fromEmail, List<Addr> recipients)
      Get a SMTP configuration from sender or recipients
      参数:
      fromEmail - the from address
      recipients - the recipients
      返回:
      the SMTP configuration
    • getSmtpCfgByToEmail

      public static List<SmtpCfg> getSmtpCfgByToEmail(List<Addr> al)
      Get all SMTP configurations that match the recipient list
      参数:
      al - the recipient list
      返回:
      the configurations
    • getSmtpCfgByToDomain

      public static List<SmtpCfg> getSmtpCfgByToDomain(List<Addr> al)
      Get all SMTP configurations that match the recipient domain list
      参数:
      al - the recipient domain list
      返回:
      the configurations
    • getDefaultSmtpCfg

      public static SmtpCfg getDefaultSmtpCfg()
    • getSmtpCfgByToEmail

      public static List<SmtpCfg> getSmtpCfgByToEmail(String toEmail)
      Get all configurations that match the to email address
      参数:
      toEmail - the to email address
      返回:
      the list
    • getSmtpCfgByToDomain

      public static List<SmtpCfg> getSmtpCfgByToDomain(String toDomain)
      Get all configurations that match the to domain
      参数:
      toDomain - the to domain name
      返回:
      the configuration list that match the to domain
    • getSmtpCfgByFromEmail

      public static List<SmtpCfg> getSmtpCfgByFromEmail(String fromEmail)
      Get all configuration that match the from email address
      参数:
      fromEmail - The from email address
      返回:
      the configuration list that match the from email address
    • getSmtpCfgByFromDomain

      public static List<SmtpCfg> getSmtpCfgByFromDomain(String fromDomain)
      Get all configurations that match the from domain name
      参数:
      fromDomain - the from domain name
      返回:
      the result
    • createMailSession

      public static javax.mail.Session createMailSession(SmtpCfg smtpCfg)
      Create a mail session
      参数:
      smtpCfg - The SMTP configuration
      返回:
      The mail session
    • createMailSession

      public static javax.mail.Session createMailSession(String host, String user, String password, int port, boolean ssl, boolean startTls)
      Create a mail session
      参数:
      host - The SMTP server host/IP
      user - The SMTP server user
      password - The SMTP server password
      port - The SMTP server port
      ssl - Whether to use SSL protocol to connect the server
      startTls - Whether to use startTls command to send the email
      返回:
      The mail session