rubyでおくるとき
コマンドラインにsendmailを置き忘れていたのでhtmlメールをrubyから送るスクリプト(例題そのまま)を書いた。
docomoの携帯電話のデコメールを実験する為のhtmlメール
#!/usr/bin/ruby require 'net/smtp' Net::SMTP.start( 'localhost', 25 ) {|smtp| smtp.send_mail <<EndOfMail, 'from@aaa.com', 'to@bbb.com' Subject: test To: aaa@bbb.com Content-Type: text/html; charset=EUC-JP <html> <body> <h1>あああ</h1> <h2>あああ</h1> <p> <font color="#ff0000">いいいい</font> </p> <div> <font color="#0000cc">ううう</font> </div> えええ </body> </html> EndOfMail }