class TestSendmail

Public Instance Methods

test_all() click to toggle source
# File vendor/qwik/lib/qwik/util-sendmail.rb, line 186
    def test_all
      sm = Qwik::Sendmail.new('127.0.0.1', '25', true)
      mail = {
        :from    => 'from@example.com',
        :to      => 'to@example.com',
        :subject => 'subject',
        :content => 'content',
      }
      assert_equal "From: from@example.com
To: to@example.com
Subject: subject
Content-Type: text/plain; charset=\"ISO-2022-JP\"

content
",
        sm.send(mail)

      mail = {
        :from    => 'from@example.com',
        :to      => 'to@example.com',
        :subject => '題名',
        :content => '本文',
      }
      assert_equal "From: from@example.com
To: to@example.com
Subject: =?ISO-2022-JP?B?GyRCQmpMPhsoQg==?=
Content-Type: text/plain; charset=\"ISO-2022-JP\"

\e$BK\\J8\e(B
",
        sm.send(mail)
    end