Class: EncodeMail

Inherits:
Mail::Message
  • Object
show all
Defined in:
lib/popper/mail_account.rb

Instance Method Summary collapse

Instance Method Details

#subjectObject



100
101
102
# File 'lib/popper/mail_account.rb', line 100

def subject
  Kconv.toutf8(self[:Subject].value) if self[:Subject]
end

#utf_bodyObject



104
105
106
107
108
109
110
111
112
113
114
# File 'lib/popper/mail_account.rb', line 104

def utf_body
  if multipart?
    if text_part
      text_part.decoded.encode("UTF-8", charset)
    elsif html_part
      html_part.decoded.encode("UTF-8", charset)
    end
  else
    body.decoded.encode("UTF-8", charset)
  end
end