send emails via perl

2014-11-19 Thread Sergio Letuche
hello, we need to use the easiest solution, if possible just use a perl module, to be able to send automated emails on an Ubuntu server. The scenario is this: we ran a cron job, and say we would like to send a message after completion, to a certain for example gmail account. The ideal would be to

Re: send emails via perl

2014-11-19 Thread Brad Baxter
This might answer that: http://perldoc.perl.org/perlfaq9.html#How-do-I-send-email%3f On Wed, Nov 19, 2014 at 3:30 AM, Sergio Letuche wrote: > hello, > > we need to use the easiest solution, if possible just use a perl module, > to be able to send automated emails on an Ubuntu server. The scenar

RE: send emails via perl

2014-11-19 Thread PHILLIPS M.E.
Not sure exactly what you mean by not using a mailer. In our Perl scripts I tend to do: open (MAIL, "|-", '/bin/mailx', '-s', $subject, @addresses) || die "Failed to e-mail report: $!\n"; print MAIL $report; close MAIL; which relies on mailx being installed and able to send messages. I’

Re: send emails via perl

2014-11-19 Thread Sergio Letuche
ok this is what i asked, could a mail be sent without mailx been installed, thank you 2014-11-19 16:19 GMT+02:00 PHILLIPS M.E. : > Not sure exactly what you mean by not using a mailer. > > > > In our Perl scripts I tend to do: > > > > open (MAIL, "|-", '/bin/mailx', '-s', $subject, @addresses)

Re: send emails via perl

2014-11-19 Thread Cory Snavely
I've always used this: http://search.cpan.org/~markov/MailTools-2.13/lib/Mail/Mailer.pod On 11/19/2014 09:22 AM, Sergio Letuche wrote: ok this is what i asked, could a mail be sent without mailx been installed, thank you 2014-11-19 16:19 GMT+02:00 PHILLIPS M.E. mailto:m.e.phill...@durham.ac.u

Re: send emails via perl

2014-11-19 Thread Sergio Letuche
thank you all for your answers, for sure there is more than one way, have to further investigate all links provided here 2014-11-19 16:24 GMT+02:00 Cory Snavely : > I've always used this: > > http://search.cpan.org/~markov/MailTools-2.13/lib/Mail/Mailer.pod > > On 11/19/2014 09:22 AM, Sergio Let

RE: send emails via perl

2014-11-19 Thread Gorman, Jon
In the past I've also done it without using a module by just doing a very bare bones Net::SMTP session if I remember right. That's included in perl in most recent versions if I remember right. (I'd have to dig around to find where I've used it, it's rare as in most cases I prefer the approach

Re: send emails via perl

2014-11-19 Thread Marc Chantreux
On Wed, Nov 19, 2014 at 02:19:26PM +, PHILLIPS M.E. wrote: > open (MAIL, "|-", '/bin/mailx', '-s', $subject, @addresses) > || die "Failed to e-mail report: $!\n"; what's the point of using perl then? -- Marc Chantreux, Mes coordonnées: http://annuaire.unistra.fr/chercher?n=chantreu

Re: send emails via perl

2014-11-19 Thread Sergio Letuche
i do not object to any approach suggested, all are welcome 2014-11-19 16:46 GMT+02:00 Marc Chantreux : > On Wed, Nov 19, 2014 at 02:19:26PM +, PHILLIPS M.E. wrote: > > open (MAIL, "|-", '/bin/mailx', '-s', $subject, @addresses) > > || die "Failed to e-mail report: $!\n"; > > what's th

RE: send emails via perl

2014-11-19 Thread PHILLIPS M.E.
> On Wed, Nov 19, 2014 at 02:19:26PM +, PHILLIPS M.E. wrote: > > open (MAIL, "|-", '/bin/mailx', '-s', $subject, @addresses) > > || die "Failed to e-mail report: $!\n"; > > what's the point of using perl then? There's more than one way to do it. If mailx is already installed and conf

Re: send emails via perl

2014-11-19 Thread Marc Chantreux
On Wed, Nov 19, 2014 at 04:47:59PM +0200, Sergio Letuche wrote: > i do not object to any approach suggested, all are welcome based on my own experience (experience feedback is something i expect when i ask something in a list): * don't use perl when i don't need it (when it's about sending a

Re: send emails via perl

2014-11-19 Thread Marc Chantreux
On Wed, Nov 19, 2014 at 02:51:58PM +, PHILLIPS M.E. wrote: > If mailx is already installed and configured then this allows you to > send your e-mail from your Perl script without installing other > modules. I have sometimes had to use servers where installing extra > modules from CPAN was not