M
Mikel Lindsaar
[Note: parts of this message were removed to make it a legal post.]
Mail has been screaming along in development over the past month.
I have replaced out TMail from ActionMailer with the Mail gem and this is
now committed as part of Rails / ActionMailer 3.0. So look out for a lot
more Mail action in the new year.
Mail 1.5.0 has some API changes from Mail 1.4.x. The biggest that will
break your use with mail is that Message#field_name now returns a default
value, instead of an object. You can still access the field object by
calling Message#[:field_name] or Message#header.field_name
This allows us to do the following:
require 'mail'
=> true
mail = Mail.new
=> #<Mail::Message:0x1021393d8...
mail.from = 'Mikel <[email protected]>'
=> "Mikel <[email protected]>"
mail.from
=> "(e-mail address removed)"
mail.from.class
=> String
mail.from 'Mikel <[email protected]>, (e-mail address removed)'
=> "Mikel <[email protected]>, (e-mail address removed)"
mail.from
=> ["(e-mail address removed)", "(e-mail address removed)"]
mail.date = Time.now
=> Sun Jan 03 11:49:00 +1100 2010
mail.date
=> Sun, 03 Jan 2010 11:49:00 +1100
mail.date.class
=> DateTime
mail.content_type 'text/plain; charset=utf-8'
=> "text/plain; charset=utf-8"
mail.content_type
=> "text/plain; charset=utf-8"
mail.mime_type
=> "text/plain"
mail.content_type_parameters
=> {"charset"=>"utf-8"}
You can still access the field objects by going via Message#[:field_name]
mail[:content_type]
=> #<Mail::Field:0x1020d04f0 @field=#<Mail::ContentTypeField:0x1020d0108...
See the change log at:
http://github.com/mikel/mail/blob/master/CHANGELOG.rdoc
Install with:
gem install mail
Instructions are at:
http://github.com/mikel/mail/
Mail has been screaming along in development over the past month.
I have replaced out TMail from ActionMailer with the Mail gem and this is
now committed as part of Rails / ActionMailer 3.0. So look out for a lot
more Mail action in the new year.
Mail 1.5.0 has some API changes from Mail 1.4.x. The biggest that will
break your use with mail is that Message#field_name now returns a default
value, instead of an object. You can still access the field object by
calling Message#[:field_name] or Message#header.field_name
This allows us to do the following:
require 'mail'
=> true
mail = Mail.new
=> #<Mail::Message:0x1021393d8...
mail.from = 'Mikel <[email protected]>'
=> "Mikel <[email protected]>"
mail.from
=> "(e-mail address removed)"
mail.from.class
=> String
mail.from 'Mikel <[email protected]>, (e-mail address removed)'
=> "Mikel <[email protected]>, (e-mail address removed)"
mail.from
=> ["(e-mail address removed)", "(e-mail address removed)"]
mail.date = Time.now
=> Sun Jan 03 11:49:00 +1100 2010
mail.date
=> Sun, 03 Jan 2010 11:49:00 +1100
mail.date.class
=> DateTime
mail.content_type 'text/plain; charset=utf-8'
=> "text/plain; charset=utf-8"
mail.content_type
=> "text/plain; charset=utf-8"
mail.mime_type
=> "text/plain"
mail.content_type_parameters
=> {"charset"=>"utf-8"}
You can still access the field objects by going via Message#[:field_name]
mail[:content_type]
=> #<Mail::Field:0x1020d04f0 @field=#<Mail::ContentTypeField:0x1020d0108...
See the change log at:
http://github.com/mikel/mail/blob/master/CHANGELOG.rdoc
Install with:
gem install mail
Instructions are at:
http://github.com/mikel/mail/