Class TMail::MimeEncodeSingle
In: lib/tmail/net.rb
Parent: Object

Methods

exec   on_binary   on_text  

Public Instance methods

[Source]

# File lib/tmail/net.rb, line 205
    def exec( mail )
      mail.mime_version = '1.0'
      b = mail.body
      if NKF.guess(b) != NKF::BINARY
        on_text b
      else
        on_binary b
      end
    end

[Source]

# File lib/tmail/net.rb, line 221
    def on_binary( body )
      mail.body = [body].pack('m')
      mail.set_content_type 'application', 'octet-stream'
      mail.encoding = 'Base64'
    end

[Source]

# File lib/tmail/net.rb, line 215
    def on_text( body )
      mail.body = NKF.nkf('-j -m0', body)
      mail.set_content_type 'text', 'plain', {'charset' => 'iso-2022-jp'}
      mail.encoding = '7bit'
    end

[Validate]