Sending mail with Ruby and ActionMailer

This is a simple, but useful little script I ended up writing to test some things. I found it easier to use this than to constantly use the mail command. It basically wraps action mailer in a small ruby script so you can call it from the command line.

./spoofmail.rb --subject='Hey You!' --body='whatsup guy?'

or using STDIN

./spoofmail.rb --subject='Hey You!' < bodyofmessage

cat|./spoofmail.rb --subject='Hey You!'
whatsup guy?

It might come in handy one day when you need to mess with a co-worker or test a mail receiver... or something else?