smtp.rb 761 B

12345678910111213141516171819202122
  1. # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
  2. class Channel::SMTP < Channel::EmailBuild
  3. def send(attr, channel, notification = false)
  4. # return if we run import mode
  5. return if Setting.get('import_mode')
  6. mail = 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. # :authentication => 'plain',
  15. :enable_starttls_auto => true
  16. }
  17. mail.deliver
  18. end
  19. end