なるべく少ないライブラリで正しい日本語のメールを送る方法について。 結論 先に結論から。 require "nkf" require "net/smtp" def sendmail(from, to, subject, body, host = "localhost", port = 25) body = <<EOT From: #{from} To: #{to.to_a.join(",\n ")} Subject: #{NKF.nkf("-WMm0", subject)} Date: #{Time::now.strftime("%a, %d %b %Y %X %z")} Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit #{NKF.nkf("-Wj