2012-04-13 16:42:25 +00:00
|
|
|
class Channel::SMTP < Channel::EmailBuild
|
2012-04-13 13:51:10 +00:00
|
|
|
include UserInfo
|
|
|
|
def send(attr, channel, notification = false)
|
2012-12-24 13:55:43 +00:00
|
|
|
|
|
|
|
# return if we run import mode
|
|
|
|
return if Setting.get('import_mode')
|
|
|
|
|
2012-04-13 16:42:25 +00:00
|
|
|
mail = build(attr, notification)
|
2012-04-13 13:51:10 +00:00
|
|
|
mail.delivery_method :smtp, {
|
|
|
|
:openssl_verify_mode => 'none',
|
|
|
|
:address => channel[:options][:host],
|
|
|
|
# :port => 587,
|
|
|
|
: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
|