Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'rubygems'
- require 'net/smtp'
- def send_email(from, from_alias, to, to_alias, subject, message)
- msg = <<END_OF_MESSAGE
- From: #{from_alias} <#{from}>
- To: #{to_alias} <#{to}>
- Subject: #{subject}
- #{message}
- END_OF_MESSAGE
- Net::SMTP.start('smtp.gmail.com', 587, 'smtp.gmail.com', 'from@gmail.com', 'password', :plain) do |smtp|
- smtp.send_message msg, from, to
- end
- end
- send_email('from@gmail.com', 'ayo', 'to@gmail.com', 'a', 'a', 'a')
Add Comment
Please, Sign In to add comment