Search in sources :

Example 1 with MEMailConfig

use of org.compiere.model.MEMailConfig in project adempiere by adempiere.

the class EMail method setEMailParameters.

/**
	 *	Set EMail Parameters (Host / Port / Encryption)
	 */
private void setEMailParameters(int p_AD_EMailConfig_ID) {
    //	
    if (p_AD_EMailConfig_ID != 0)
        m_AD_EMailConfig_ID = p_AD_EMailConfig_ID;
    //	Validate Config
    if (m_AD_EMailConfig_ID == 0) {
        MClient client = MClient.get(m_ctx);
        m_AD_EMailConfig_ID = client.getAD_EMailConfig_ID();
    }
    MEMailConfig eMailConfig = MEMailConfig.get(m_ctx, m_AD_EMailConfig_ID);
    //	Valid null
    if (eMailConfig != null) {
        m_Host = eMailConfig.getSMTPHost();
        //	
        m_Port = eMailConfig.getPort();
        m_Timeout = eMailConfig.getTimeout();
        m_ConnectionTimeout = eMailConfig.getConnectionTimeout();
        m_Protocol = eMailConfig.getProtocol();
        m_EncryptionType = eMailConfig.getEncryptionType();
        m_AuthMechanism = eMailConfig.getAuthMechanism();
        m_IsSmtpAuthorization = eMailConfig.isSmtpAuthorization();
        m_Domain = eMailConfig.getLDAPDomain();
    } else {
        getPort();
        getProtocol();
        getEncryptionType();
        getAuthMechanism();
        m_IsSmtpAuthorization = false;
    }
}
Also used : MEMailConfig(org.compiere.model.MEMailConfig) MClient(org.compiere.model.MClient)

Aggregations

MClient (org.compiere.model.MClient)1 MEMailConfig (org.compiere.model.MEMailConfig)1