options = { :address => "smtp.gmail.com",
:port => 587,
:domain => 'domain.com',
:user_name => 'mail@domain.com',
:password => 'mail_password',
:authentication => 'plain',
:enable_starttls_auto => true }
Mail.defaults do
delivery_method :smtp, options
end
#Sending
Mail.deliver do
from 'mail@domain.com'
to 'admin@domain.com'
subject 'some subject'
html_part do
content_type 'text/html; charset=UTF-8'
body "#{html_mail}"
end
end
Find more questions by tags Ruby