smtp.rb 629 B

123456789101112131415161718192021
  1. # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
  2. class Channel::SMTP
  3. def send(attr, channel, notification = false)
  4. # return if we run import mode
  5. return if Setting.get('import_mode')
  6. mail = Channel::EmailBuild.build(attr, notification)
  7. mail.delivery_method :smtp, {
  8. openssl_verify_mode: 'none',
  9. address: channel[:options][:host],
  10. port: channel[:options][:port] || 25,
  11. domain: channel[:options][:host],
  12. user_name: channel[:options][:user],
  13. password: channel[:options][:password],
  14. enable_starttls_auto: true,
  15. }
  16. mail.deliver
  17. end
  18. end