Skip to content

Instantly share code, notes, and snippets.

@chaserx
Created January 4, 2010 20:26
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 chaserx/268830 to your computer and use it in GitHub Desktop.
Save chaserx/268830 to your computer and use it in GitHub Desktop.
quick dirty gmail to txt msg
#!/usr/local/bin/ruby -wKU
require 'rubygems'
require 'gmail'
# Chase Southard
# 12.31.2009
# chase {dot} southard [at] gmail {dot} com
# requires ruby-gmail gem #=> http://dcparker.github.com/ruby-gmail/
# email-to-textmessage-by-email carrier translation via this file http://github.com/brendanlim/sms-fu/blob/master/templates/sms_fu.yml
# Inspired by Merbist to send a happy new year message to friends (http://twitter.com/merbist/status/7240862705), I did this.
# Written just before the ball drop
# This has a number of shortfalls:
# - could interface with AddressBook or Google Contacts
# - could also interface with Twitter
# - could pull from some kind of structured file
# - use SMS-Fu as module outside of rails
gmail = Gmail.new('username', 'password')
recipients = ['8595551234@txt.att.net', '8595555676@messaging.sprintpcs.com', '8595550123@vtext.com']
recipients.each { |e|
new_email = MIME::Message.generate
new_email.to e.to_s
new_email.content = "Wishing you a Happy New Year!\n"
gmail.send_email(new_email)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment