require 'net/smtp'

def send_email(from, from_alias, to, to_alias, subject, message)
  msg = <<END_OF_MESSAGE
From: #{from_alias} <#{from}>
To: #{to_alias} <#{to}>
Subject: #{subject}

#{message}
END_OF_MESSAGE

  Net::SMTP.start("smpt.server", 25) do |smtp|
    smtp.send_mail msg, from, to
  end
end

send_email("from", "from_alias", "to", "to_alias", "subject", "message")

-- 
Posted via http://www.ruby-forum.com/.