require 'mail'
options = {
:address => "smtp.gmail.com",
:port => 587,
:user_name => '<gmail user name>@gmail.com',
:password => '<gmail password>',
:authentication => 'plain',
:enable_starttls_auto => true
}
Mail.defaults do
delivery_method :smtp, options
end
Mail.deliver do
to '<email of receiver>'
from '<gmail user name>@gmail.com'
subject 'Subject - Ruby Email via Gmail SMTP'
body 'sample content sample content sample content '
end
Please do post your queries and suggestions in the comments section below.