Skip to content

Instantly share code, notes, and snippets.

@skylerto
Created May 30, 2017 13:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skylerto/60f111ae6cd0280c304c98cabd1ec8a6 to your computer and use it in GitHub Desktop.
Save skylerto/60f111ae6cd0280c304c98cabd1ec8a6 to your computer and use it in GitHub Desktop.
require 'mail'
args = ARGV
user = args[0]
pass = args[1]
options = { :address => "smtp.gmail.com",
:port => 587,
:user_name => user,
:password => pass,
:authentication => 'plain',
:enable_starttls_auto => true }
Mail.defaults do
delivery_method :smtp, options
end
to =
Mail.deliver do
to user
from user
subject 'This is a Test'
body 'This is a test to determine if mail can be sent'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment