[ANN] Mail 1.5.0

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/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

[ANN] mail Gem version 1.3.0 0
[ANN] mail 14
[ANN] Mail 2.2.0 0
[ANN] Mail 2.2.6 Released 0
[ANN] Mail 2.1.5 Pushed 0
[ANN] Mail 2.2.10 Release Announcement 0
[ANN] TMail 1.2.3 - Security Update 0
ruby mail help 0

Members online

Forum statistics

Threads
473,981
Messages
2,570,187
Members
46,731
Latest member
MarcyGipso

Latest Threads

Top