Created
November 2, 2014 01:39
-
-
Save tily/ec9d9c1dd41b8464ce32 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'mail' | |
def main(args) | |
system *args | |
mail args | |
end | |
def mail(args) | |
message = "finished(#{$?.exitstatus}) : #{args.join(' ')}" | |
Mail.defaults do | |
delivery_method :smtp, { | |
:address => "smtp.gmail.com", | |
:port => 587, | |
:domain => 'gmail.com', | |
:user_name => 'tidnlyam', | |
:password => ENV['PASSWORD'], | |
:authentication => 'plain', | |
:enable_starttls_auto => true | |
} | |
end | |
Mail.deliver do | |
to 'tidnlyam@gmail.com' | |
from 'tidnlyam@gmail.com' | |
subject message | |
body message | |
end | |
end | |
main(ARGV.dup) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment