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
238 239 240 241 242 243 244 245 246 |
# File 'lib/action_mailer/vendor/tmail/net.rb', line 238 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
254 255 256 257 258 |
# File 'lib/action_mailer/vendor/tmail/net.rb', line 254 def on_binary( body ) mail.body = [body].pack('m') mail.set_content_type 'application', 'octet-stream' mail.encoding = 'Base64' end |
#on_text(body) ⇒ Object
248 249 250 251 252 |
# File 'lib/action_mailer/vendor/tmail/net.rb', line 248 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 |