Perl Oasis 2011

Sending Email with Perl

By Chris Nehren (‎apeiron‎) from,,
Date: Saturday, 15 January 2011 14:30
Duration: 40 minutes
Target audience: Any
Tags: alt.mime lite.die.die.die mime

Have you ever wan­ted to send com­plex email mes­sages from Perl? Were you suc­cess­ful? Did you get lost try­ing to navigate the forest of Email:: and Mail:: modules, not sure wheth­er you wan­ted Mail::Box or Email::Stuff or Mail::Sendmail? This talk is for you. In this talk, I'll cover 90% of what you need to know about sen­d­ing email from perl. I spent about a year work­ing on email code bet­ween two jobs, one of those being Pobox (hi, rjbs!). I lear­ned a lot about how email works and doesn't work in Perl, and what the best prac­tices are. It's not as hard as you think, and it's gett­ing simpl­er all the time. This talk co­v­ers the story of em­ail­ing a newslett­er. It starts sim­ple, with a plain­text email going to a li­mited numb­er of re­cipients, and scales up to a multi­part MIME mes­sage with templated HTML and plain­text parts (with verifica­tion that the template values validate ac­cord­ing to rules you set), image at­tach­ments, SMTP TLS aut­hentica­tion, etc. This talk starts at the be­ginn­ing and works its way up to the state of the art in sen­d­ing enterprise-quality email with Perl. Most peo­ple who haven't wor­ked heavi­ly with email in Perl should learn at least some­th­ing.

Attended by: Stefan Hornburg (‎racke‎), Mark Keating (‎mdk‎), Chris Nehren (‎apeiron‎),