Class: TMail::MimeEncodeSingle
- Inherits:
-
Object
- Object
- TMail::MimeEncodeSingle
- Defined in:
- lib/action_mailer/vendor/tmail/net.rb
Instance Method Summary collapse
Instance Method Details
#exec(mail) ⇒ Object
219 220 221 222 223 224 225 226 227 |
# File 'lib/action_mailer/vendor/tmail/net.rb', line 219 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 |
#on_binary(body) ⇒ Object
235 236 237 238 239 |
# File 'lib/action_mailer/vendor/tmail/net.rb', line 235 def on_binary( body ) mail.body = [body].pack('m') mail.set_content_type 'application', 'octet-stream' mail.encoding = 'Base64' end |
#on_text(body) ⇒ Object
229 230 231 232 233 |
# File 'lib/action_mailer/vendor/tmail/net.rb', line 229 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 |