"I consider myself socially liberal, but fiscally conservative." that sounds like "i'd like to have all the socially feel good programs like good public schools, homeless shelters and stuff. but i don't want to give up any of my money." well then, i guess i'm also socially liberal, but fiscally conservative. that'd sure be cool if those socially liberal things happened and i had all my money. but that's not realistic. where does the money for being socially liberal come from if not from liberal taxes? you can't pick and choose the nice things of different ideals. they are a complete package, which is why there exists so much discussion about them.
that is my rant. just remembered discussion from long ago (years) and crystallized the response.
posting without reviewing, yeah!
Tuesday, October 20, 2009
Thursday, October 15, 2009
send email through gmail via ruby 1.8.7 and later
this took me some searching and eventually talking to drbrain on freenode #ruby-lang. i then found that drbrain wrote the ruby gem smtp_tls which makes this work for 1.8.6 and possibly earlier. so that's kinda cool.
here's the minimal ruby example. put this in a file
here's the minimal ruby example. put this in a file
require 'net/smtp'
host = 'smtp.gmail.com'
port = 587
relay_domain = 'example.com' #doesn't matter
send_account = 'gmail_account' # i.e. "example" from "example@google.com"
recv_account = 'receiver_account' #i.e. "acct" from "acct@example.com"
pw = "password"
auth_type = :login #:cram_md5 doesn't work
from ="#{send_account}@gmail.com"
to = "#{recv_account}@example.com"
subject = "subject line goodness"
body = "look, it's an email body!"
msg = <<END_OF_MESSAGE
From: #{from}
To: #{to}
Subject: #{subject}
#{body}
END_OF_MESSAGE
smtp = Net::SMTP.new host, port
smtp.enable_starttls
smtp.start(relay_domain, send_account, pw, auth_type) do |server|
server.send_message(msg, from, to)
end
Subscribe to:
Posts (Atom)