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

20 lines
686 B
Ruby
Raw Normal View History

class Channel::SMTP < Channel::EmailBuild
def send(attr, channel, notification = false)
# return if we run import mode
return if Setting.get('import_mode')
mail = 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],
# :authentication => 'plain',
:enable_starttls_auto => true
}
mail.deliver
end
end