trabajo-afectivo/app/models/channel/smtp.rb

22 lines
731 B
Ruby
Raw Normal View History

2014-02-03 19:23:00 +00:00
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
2014-12-27 15:25:58 +00:00
class Channel::SMTP
include Channel::EmailBuild
def send(attr, channel, notification = false)
# return if we run import mode
return if Setting.get('import_mode')
2014-12-27 15:25:58 +00:00
mail = self.build(attr, notification)
mail.delivery_method :smtp, {
:openssl_verify_mode => 'none',
:address => channel[:options][:host],
2013-01-04 22:30:57 +00:00
:port => channel[:options][:port] || 25,
:domain => channel[:options][:host],
:user_name => channel[:options][:user],
:password => channel[:options][:password],
:enable_starttls_auto => true,
}
mail.deliver
end
2014-12-14 19:18:54 +00:00
end