# Mail 1.5.0

**URL:** <https://www.ruby-forum.com/t/mail-1-5-0/180986>\
**Category:** Ruby\
**Created:** [January 3, 2010, 2:00am UTC](https://www.ruby-forum.com/t/mail-1-5-0/180986 "2010-01-03T02:00:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mikel\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/2bfe46/32.png) [@Mikel\_L](https://www.ruby-forum.com/u/Mikel_L)\
**Post date:** [January 3, 2010, 2:00am UTC](https://www.ruby-forum.com/t/mail-1-5-0/180986/1 "2010-01-03T02:00:49Z")

</div>

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 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)’  
=\> “Mikel [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)”  
mail.from  
=\> “removed\_email\_address@domain.invalid”  
mail.from.class  
=\> String  
mail.from ‘Mikel [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid), removed\_email\_address@domain.invalid’  
=\> “Mikel [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid), removed\_email\_address@domain.invalid”  
mail.from  
=\> [“removed\_email\_address@domain.invalid”, “removed\_email\_address@domain.invalid”]  
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:

> <https://github.com/mikel/mail/blob/master/CHANGELOG.rdoc>

Install with:

gem install mail

Instructions are at:

> **[GitHub - mikel/mail: A Really Ruby Mail Library](https://github.com/mikel/mail/)**
>
> A Really Ruby Mail Library. Contribute to mikel/mail development by creating an account on GitHub.
