Which CPAN package should I use to send mail?

Which CPAN package should I use to send mail ?

The timtowtdi approach is sometimes very tedious. For me, especially when it comes to choosing a package.

So all I want to do is send an email, maybe an HTML email. Between Mail-Sendmail, Mail-Sender, NET-SMTP (by the way, it is not available in PPM), Mail-SendEasy and 80 or so other packages that have Mail in their package name - which should I choose?

And although in this matter, what is your general exam, choose the "canonical" package for the run. That is a package that everyone uses. Is there a rating or popularity billboard somewhere?

+7
module perl cpan
source share
6 answers

What is your overall rating for choosing a “canonical” jogging package? That is a package that everyone uses. Is there any rating or popularity billboard?

When I want to choose which of several CPAN modules to use, what I look at is

Documentation:

The litmus test for CPAN modules is the first page of documentation. If there is a useless synopsis or synopsis without a simple working example, I think the module is probably not very good. Incorrect, dirty or incorrectly generated documentation is also a red flag.

Repair Status:

  • the release date of the latest version of the module tells you if it is supported,
  • CPAN tester reports tell you if a module can install without a fight.
  • The error list on rt.cpan.org gives you some idea of ​​how active the author is in maintaining the module.

Also, is there a mailing list for the module? Having a mailing list is a pretty good sign of a good, maintained, stable, documented, and popular module.

Author:

  • What is the name of the author of the module?
  • How many other released modules have been released?
  • What modules did the author release?

The author is a big factor. There are some authors who create excellent qualities, such as Gisle Aas, Graham Barr, Andy Wardley or Jan DuBois, as well as some people who get a lot of things that could be called "experimental", such as Damian Conway or Tatsuhiko Miyagawa. Be careful with people who have released many Acme :: modules (just kidding). Also, beware of things written by people who only support one or two modules. People who have less than five modules usually do not support them.

Other things:

cpanratings.perl.org often helps, but take it with salt.

In addition, many of them are simply trial and error. Download and see if it passes its own tests, see if it has any tests, write a test script, etc.

Things that often do not give a significant rating:

  • Google's best results tend to be ancient Perlmonks or perl.com or Dr. Dobs' article articles, and they often point you to outdated things.
  • The search.cpan.org search function places modules that have not been updated for ten years on the first page, as well as the latest and most recent on page 10 or something like that.

Beware of the "hype":

One more thing I want to say: be careful about blog tips, stackoverflow, Usenet news, etc. - People tend to direct you to which module is the flavor of the month, and not a stable, proven solution. “Fashionable” modules, as a rule, have no documentation, are unstable, have a nightmare addiction, and often yesterday, fashionable modules suddenly fall out of favor and are abandoned to be replaced by a different taste of the month, leaving you in trouble if you decide to use them.

+15
source share

Task :: Kensho usually gives good recommendations. To send an email, he offers Email :: Sender

+9
source share

I will write Email :: Stuff. This is a good cover for Email :: MIME. You do not need to worry about the structure of MIME mail, the module does this for you.

Email::Stuff->from ('cpan@ali.as' ) ->to ('santa@northpole.org' ) ->bcc ('bunbun@sluggy.com' ) ->text_body($body ) ->attach (io('dead_bunbun_faked.gif')->all, filename => 'dead_bunbun_proof.gif') ->send; 

Regarding the choice of modules,

+3
source share

If you don't need more basic features, I suggest looking at Mime :: Lite .

 use MIME::Lite; my $msg = new MIME::Lite From => 'Your friendly neighbourhood spiderman', To => 'green@goblin.net', CC => 'info@nemesis.org', BCC => 'mj@spidey.info', 'Reply-to' => 'enemies@spidey.info', Subject => 'Please stop', Data => $data; #Email body die 'Could not send mail' unless ($msg->send); 
0
source share
0
source share

I prefer

Mail :: Sendmail

MIME :: Lite

If you require SSL, enable

Net :: SMTP :: SSL

0
source share

All Articles