class Mail::Body

Attributes

mobile[RW]

Public Instance Methods

crlf_boundary() click to toggle source
crlf_boundary_with_jpmobile() click to toggle source
# File lib/jpmobile/mail.rb, line 373
def crlf_boundary_with_jpmobile
  if @mobile
    Jpmobile::Util.encode(crlf_boundary_without_jpmobile, @charset)
  else
    crlf_boundary_without_jpmobile
  end
end
Also aliased as: crlf_boundary
crlf_boundary_without_jpmobile() click to toggle source
Alias for: crlf_boundary
decode_transfer_encoding() click to toggle source
# File lib/jpmobile/mail.rb, line 348
def decode_transfer_encoding
  _raw_source = Encodings.get_encoding(encoding).decode(@raw_source)
  unless Jpmobile::Util.extract_charset(_raw_source) == @charset
    @charset = Jpmobile::Util.extract_charset(_raw_source)
  end
  _raw_source = Jpmobile::Util.set_encoding(_raw_source, @charset)
  @raw_source = @mobile.decode_transfer_encoding(_raw_source, @charset)
end
decoded() click to toggle source
Also aliased as: decoded_without_jpmobile
decoded_with_jpmobile() click to toggle source
# File lib/jpmobile/mail.rb, line 326
def decoded_with_jpmobile
  decoded_without_jpmobile
end
Also aliased as: decoded
decoded_without_jpmobile() click to toggle source
Alias for: decoded
encoded(transfer_encoding = '8bit') click to toggle source
Also aliased as: encoded_without_jpmobile
encoded_with_jpmobile(transfer_encoding = '8bit') click to toggle source

convert encoding

# File lib/jpmobile/mail.rb, line 305
def encoded_with_jpmobile(transfer_encoding = '8bit')
  if @mobile and !multipart?
    if @mobile.to_mail_body_encoded?(@raw_source)
      @raw_source
    elsif Jpmobile::Util.ascii_8bit?(@raw_source)
      enc = Mail::Encodings::get_encoding(get_best_encoding(transfer_encoding))
      Jpmobile::Util.force_encode(enc.encode(@raw_source), nil, @charset)
    else
      if transfer_encoding == 'quoted-printable'
        # [str].pack("M").gsub(/\n/, "\r\n")
        Jpmobile::Util.force_encode([@mobile.to_mail_body(Jpmobile::Util.force_encode(@raw_source, @charset, Jpmobile::Util::UTF8))].pack("M").gsub(/\n/, "\r\n"), Jpmobile::Util::BINARY, @charset)
        # @mobile.to_mail_body(Jpmobile::Util.force_encode(@raw_source, @charset, Jpmobile::Util::UTF8))
      else
        @mobile.to_mail_body(Jpmobile::Util.force_encode(@raw_source, @charset, Jpmobile::Util::UTF8))
      end
    end
  else
    encoded_without_jpmobile(transfer_encoding)
  end
end
Also aliased as: encoded
encoded_without_jpmobile(transfer_encoding = '8bit') click to toggle source
Alias for: encoded
end_boundary() click to toggle source
end_boundary_with_jpmobile() click to toggle source
# File lib/jpmobile/mail.rb, line 381
def end_boundary_with_jpmobile
  if @mobile
    Jpmobile::Util.encode(end_boundary_without_jpmobile, @charset)
  else
    end_boundary_without_jpmobile
  end
end
Also aliased as: end_boundary
end_boundary_without_jpmobile() click to toggle source
Alias for: end_boundary
epilogue() click to toggle source
Also aliased as: epilogue_without_jpmobile
epilogue_with_jpmobile() click to toggle source
# File lib/jpmobile/mail.rb, line 365
def epilogue_with_jpmobile
  if @mobile
    Jpmobile::Util.encode(@epilogue, @charset)
  else
    epilogue_without_jpmobile
  end
end
Also aliased as: epilogue
epilogue_without_jpmobile() click to toggle source
Alias for: epilogue
mobile=(m) click to toggle source
# File lib/jpmobile/mail.rb, line 335
def mobile=(m)
  @mobile = m

  if self.multipart? and @mobile
    self.parts.each do |part|
      part.charset      = @charset
      part.mobile       = @mobile
      part.body.charset = @charset
      part.body.mobile  = @mobile
    end
  end
end
preamble() click to toggle source
Also aliased as: preamble_without_jpmobile
preamble_with_jpmobile() click to toggle source
# File lib/jpmobile/mail.rb, line 357
def preamble_with_jpmobile
  if @mobile
    Jpmobile::Util.encode(@preamble, @charset)
  else
    preamble_without_jpmobile
  end
end
Also aliased as: preamble
preamble_without_jpmobile() click to toggle source
Alias for: preamble
set_charset() click to toggle source
Also aliased as: set_charset_without_jpmobile
set_charset_with_jpmobile() click to toggle source

fix charset

# File lib/jpmobile/mail.rb, line 331
def set_charset_with_jpmobile
  @charset ||= only_us_ascii? ? 'US-ASCII' : nil
end
Also aliased as: set_charset
set_charset_without_jpmobile() click to toggle source
Alias for: set_charset