Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Mail Options

by lig (Acolyte)
on Jul 29, 2005 at 04:09 UTC ( [id://479237]=perlquestion: print w/replies, xml ) Need Help??

lig has asked for the wisdom of the Perl Monks concerning the following question:

I am very new to Perl and Perl Monks (this is my first post actually) but have been asked by the Boss to research modules to use for the reading and writing of MIME emails. I have searched CPAN (using "Mail" and "Email" - though I admit to not going any deeper then the first 5 pages each) and found the Mail::Box module (it only reads). By also referencing an older book I have (O'Reillys "Programming Internet Mail" 1999) I was also directed to MIME-Lite (only writes) and MIME-tools. (MailFolder was also referenced but it is still in alpha so I skipped it.)

I am considering refering MIME-tools since it seems to have all the functionality I need but it also seems a bit of over kill. The alternative I am also considering recommending is using Mail::Box and MIME-Lite to cover the needed functionality without a lot of extras.

Now for my questions (finally). First - have I missed any modules (or group of modules) that should be taken into consideration as a viable solution? Second - Of my 2 possible solutions - which do you think is better and why?

life is a game... so have fun.

Replies are listed 'Best First'.
Re: Mail Options
by spectraphonic (Scribe) on Jul 29, 2005 at 05:42 UTC

    first let me say that i've never written any perl code that handles email.

    but i think you searched CPAN with the wrong terms... i did a quick search at CPAN for MIME (click here) and got a list of MIME related modules that should help you. like i said i've never tried any of the modules, so i cant really offer anything else, but i hope this helps you.

    ~spectraphonic

Re: Mail Options
by Akhasha (Scribe) on Jul 29, 2005 at 07:54 UTC
    I don't know if you've missed any worthwhile modules, but I'd like to suggest MIME-tools as the way to go. While the documentation is a bit hairy, for simple tasks the use of MIME::Parser etc is quite simple. We use it for most email related tasks, though in some places in our codebase we fire off simple emails with MIME::Lite.
Re: Mail Options
by davorg (Chancellor) on Jul 29, 2005 at 13:19 UTC

    The Perl Email Project is an attempt to make sense of the confusion of Perl email modules and to replace them with a new and consistant set of modules. I find that their modules are enough for all of my Perl emailing needs.

    --
    <http://www.dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg

Re: Mail Options
by data64 (Chaplain) on Jul 29, 2005 at 13:11 UTC

    You might also want to browse through our Module Reviews section. There are reviews on some of the mail related modules, which might give you more insight.

Re: Mail Options
by techra (Pilgrim) on Jul 29, 2005 at 15:08 UTC

    I've walked down this road a few times, and I think I've finally decided on what the best option is.

    Originally around here at the company I worked for there was a bad habit of just opening a pipe to SENDMAIL. People did this in our core perl modules. And I still want to slap them for it. Don't do that. It makes your code less portable and makes assumptions (like that sendmail is on the system, or that sendmail is configured properly..)

    So there's Mail::Sendmail and that's a fine module if you just want to do your standard emails. It alows you to set SMTP hosts and all that good stuff.

    Then there's Mail::SendEasy which I used on a site for awhile. Very easy to set up into a templating system, however -- the HTML emails it creates are all wonky! Spam filters hate them, and the module doesn't provide an interface to set your messages as quoted-printable, so the text portions of the emails still show up all encoded funky.

    I've settled on MIME::Lite for all my email sending needs. It does everything you'll ever want. It's intuitive. It's just right. That's my 2 cents.

Re: Mail Options
by newroz (Monk) on Jul 29, 2005 at 08:01 UTC
    For writing an email , this example can show you a way mimesend .
    For striping out an attachment:
    #!/usr/bin/perl use MIME::Parser; foreach(@ARGV){ $p = new MIME::Parser; $e = $p->parse_open($_); }
    I haven't used any other modules. Examine MIME-tools, it is a powerful module.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://479237]
Approved by jbrugger
Front-paged by jbrugger
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-04-25 11:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found