class UserMailer < ActionMailer::Base
UserMailer.smtp_settings = {
:tls => Model.find_by_column_name("SMTP_TLS").column_name,
:address => Model.find_by_column_name("SMTP_ADDRESS").column_name,
:port => Model.find_by_column_name("SMTP_PORT").column_name,
:domain => Model.find_by_column_name("SMTP_DOMAIN").column_name
}
def mail_example(to_address,subject,options={})
sender(to_address,subject,options)
end
def sender(to_address,subject,options)
recipients to_address
from Model.find_by_column_name("SMTP_FROM_ADDRESS").column_name
subject subject
sent_on Time.now
body options
end
end
Я создал функцию общего отправителя.Может быть, это поможет.