Created
April 12, 2012 05:49
-
-
Save aliou/2364807 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'gmail' | |
config_file = "#{ENV['HOME']}/.gmail" | |
unless File.exist?(config_file) | |
puts "You need to type your email and password (one per line) into `~/.gmail`." | |
exit!(1) | |
end | |
# if ARGV[0].nil? | |
# puts "You need to specify a file to send." | |
# exit!(1) | |
# end | |
username,password = File.read(config_file).split("\n") | |
gmail = Gmail.connect!(username, password) | |
gmail.deliver do | |
to "<email_adress>" | |
subject "<Subject>" | |
text_part do | |
body "<message>" | |
end | |
# ARGV.each do |fic| | |
# add_file fic | |
# end | |
end | |
gmail.logout |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment