Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 

38 rader
1.2 KiB

  1. package com.ffii.fpsms.modules.common
  2. import com.ffii.fpsms.modules.settings.service.SettingsService
  3. import org.apache.commons.lang3.StringUtils
  4. open class MailSMTP(settingsService: SettingsService) {
  5. open var host: String? = null
  6. open var port: Int? = null
  7. open var username: String? = null
  8. open var password: String? = null
  9. open var auth: Boolean? = null
  10. init {
  11. this.host = settingsService.getString(SettingNames.MAIL_SMTP_HOST)
  12. this.port = settingsService.getInt(SettingNames.MAIL_SMTP_PORT)
  13. this.username = settingsService.getString(SettingNames.MAIL_SMTP_USERNAME)
  14. this.password = settingsService.getString(SettingNames.MAIL_SMTP_PASSWORD)
  15. this.auth = settingsService.getBoolean(SettingNames.MAIL_SMTP_AUTH)
  16. }
  17. final override fun equals(other: Any?): Boolean {
  18. if (other == null || other !is MailSMTP) return false
  19. val o = other as MailSMTP
  20. if (StringUtils.equals(
  21. this.host,
  22. o.host
  23. ) && this.port == o.port &&
  24. StringUtils.equals(this.username, o.username) &&
  25. StringUtils.equals(this.password, o.password)
  26. ) {
  27. return true
  28. }
  29. return false
  30. }
  31. }