mailstr = 'Subject: test mail From: hoge@example.com To: fuga@example.com Date: Thu, 21 Sep 2099 11:03:15 +0900 (JST) Mime-version: 1.0 あいうえお' SENDMAIL = '/usr/sbin/sendmail' addr = 'hoge@example.com' to = 'fuga@example.com' IO.popen("#{SENDMAIL} -i -f#{addr} #{to}", 'w') do |fp| fp.puts mailstr end