ActionMailer with Mail - new version

$ git clone git://
$ cd rails/actionmailer
$ gem install mail
$ rake

You should get 0 errors and 0 failures.

This is tested on Ruby 1.8.6, 1.8.7, 1.9.1 and 1.9.1-head (1.9.2)

Please feel free to test with your favourite ActionMailer rails app.

The major changes from using TMail to Mail are:

1) mail_object#to_s returns the encoded value ready for insert into
email, so this includes the header field name. If you want the decoded
part of a header field, call #decoded

2) Mail does not have "quoted_body", "quoted_subject" etc. All of
these are accessed via body.encoded, subject.encoded etc

3) Every part of a Mail object returns an object, never a string. So
Mail.body returns a Mail::Body class object, need to call #encoded or
#decoded to get the string you want

4) Mail::Message#set_content_type does not exist, it is simply

5) Every mail message gets a unique message_id unless you specify one,
had to change all the tests that check for equality with
expected.encoded == actual.encoded to first replace their message_ids
with control values

6) Mail now has a proper concept of parts, remove the
ActionMailer::Part and ActionMailer::PartContainer classes

7) Calling #encoded on any object returns it as a string ready to go
into the output stream of an email, this means it includes the \r\n at
the end of the lines and the object is pre-wrapped with \r\n\t if it
is a header field. Also, the "encoded" value includes the field name
if it is a header field.

8) Attachments are only the actual attachment, with filename etc. A
part contains an attachment. The part has the content_type etc. So
attachments.last.content_type is invalid. But parts.last.content_type

9) There is no idea of a "sub_head" in Mail. A part is just a Message
with some extra functionality, so it just has a "header" like a normal
mail message