Mail, TMail, The Future of Ruby Email Handling

Thu Sep 17 11:29:43 -0700 2009

You may know I maintain the TMail library. Well, recently I’ve been working on the next version.

TMail was getting hard to maintain and monkey patch. It’s implementation does not take into account many little things that create a problem when trying to get Ruby 1.9 compatibility working.

Anyway, I started working on Mail… code speaks louder than words… so Mail can do the following right now:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Mail.defaults do
  smtp '127.0.0.1'
end

Mail.deliver do
  to 'nicolas@test.lindsaar.net.au'
  from 'Mikel Lindsaar <mikel@test.lindsaar.net.au>'
  subject 'First multipart email sent with Mail'
  text_part do
    body 'Here is the attachment you wanted'
  end
  html_part do
    content_type 'text/html; charset=UTF-8'
    body '<h1>Funky Title</h1><p>Here it is</p>'
  end
  add_file :filename => '/path/to/myfile.pdf'
end

And you just sent a multipart text and html email with an attachment!

Mail is my attempt to just HANDLE the problem of Ruby Email handling.

I developed it from the ground up with complete spec coverage… I am not quite at 100%... but very close. It is also a completely object oriented design and pure ruby too!

Mail tries it’s darn hardest not to crash. In fact it already checks every email in the TMail test suite and doesn’t crash once on parsing any of the emails in there.

In any case, I now have pretty much all the basic email and mime and attachment handlings working. Next up is handling multiple character sets in the header and body.

You are welcome to check it out from my GitHub account

It’s version 0.1 right now… but expect to see the multi character set support soon.

Forks and patches welcome!

Mikel

  1. Realtech Says:

    Bestech believes that it has an edge in the field of Real Estate Development because the group has the combined strength of conceptualization with 100% implementation and delivery.
    bestech park view ananda

  2. Realtech Says:

    Bestech believes that it has an edge in the field of Real Estate Development because the group has the combined strength of conceptualization with 100% implementation and delivery.
    bestech park view ananda

  3. Realtech Says:

    Bestech believes that it has an edge in the field of Real Estate Development because the group has the combined strength of conceptualization with 100% implementation and delivery.
    bestech park view ananda

  4. Georg Ledermann Says:

    After struggling with TMail in my current Rails app I would appreciate it very much to have a modern Mail gem.

    But please, don’t forget the old TMail gem until it’s fully replaced by Mail. I tried to install the TMail gem from github without luck. I have described the issue here: http://github.com/mikel/tmail/issues#issue/4

    It seems it’s not easy to use the current fixes of TMail and replace the embedded gem of ActionMailer.

  5. tperdnalcar Says:

    After struggling with TMail in my current Rails app I would appreciate it very much to have a modern Mail gem.

  6. dfhdsfh Says:

    speaking of bounced emails, does your email mikel(@)this domain work? I found a minor css problem on the code snippets not rendering properly on Windows, Google Chrome (eek) need to change line-height from 99% to 100% qqyjivwk sr jobhmtzi jy rwzfjrwf te zakxxbnsv

  7. Bible Study Lessons by T.O.D. Johnston Says:

    Great code for implementing Ruby email handling. Bible Study Lessons by T.O.D. Johnston

  8. grand rapids djs Says:

    This is great tutorial for handling RUBY email and your suggestions is very easy to follow. grand rapids djs

  9. how to seo my website Says:

    This has made it very easy to use RUBY’s email platform.
    how to seo yourself

  10. Cuba Explorer Tours Says:

    I like using RUBY email cuba explorer tours because its so easy to use wherever I go

  11. valentines day cards Says:

    There are plenty of information about this topic in the net & some are definitely better than others.

  12. baseball field covers Says:

    Ruby email are excellent email platform because its stable and quick baseball field covers

  13. Trevinol Says:

    Ruby email is very stable and that is the reason that a lot of people like using it baseball field covers

  14. Vitalzym Says:

    Ruby is a great coding language to learn because its very flexible and easy to use Vitalzym

  15. proxy server Says:

    Do you think that the email with Ruby interface is stable compare to other platforms that are available today proxy server

  16. Ralph Says:

    I have been using this code for a couple of years now and I have to say that its very stable and easy to use Travel Insurance Singapore

Leave a Reply