Re: send emails via perl

[email protected] (Sergio Letuche) Wed, 19 Nov 2014 16:29:49 +0200
Newsgroups perl.perl4lib
Message-ID <CANnh_k8+ZQ6n8-9oOOknv1ygXgr+O9sZnP_4umW7MbUvB3AoMw@mail.gmail.com>
--001a11c167785571350508370b0b
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

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 <[email protected]>:

> 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. <[email protected]
>> <mailto:[email protected]>>:
>>
>>     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=E2=80=99m sure there are SMTP modules for Perl, and things like th=
at which
>>     could do it all at socket level, but I wouldn=E2=80=99t see that as =
being
>>     easier necessarily. It depends on what control you have over your
>>     server.____
>>
>>     __ __
>>
>>     Matthew____
>>
>>     __ __
>>
>>     *From:*Sergio Letuche [mailto:[email protected]
>>     <mailto:[email protected]>]
>>     *Sent:* 19 November 2014 08:31
>>     *To:* [email protected] <mailto:[email protected]>
>>     *Subject:* send emails via perl____
>>
>>     __ __
>>
>>     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 not use any mailer, is this possible? Or could
>>     you please suggest us the best - easiest approach?____
>>
>>     __ __
>>
>>     Thank you____
>>
>>
>>

--001a11c167785571350508370b0b
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">thank you all for your answers,<div><br></div><div>for sur=
e there is more than one way, have to further investigate all links provide=
d here</div></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote"=
>2014-11-19 16:24 GMT+02:00 Cory Snavely <span dir=3D"ltr">&lt;<a href=3D"m=
ailto:[email protected]" target=3D"_blank">[email protected]</a>&gt;</spa=
n>:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-=
left:1px #ccc solid;padding-left:1ex">I&#39;ve always used this:<br>
<br>
<a href=3D"http://search.cpan.org/~markov/MailTools-2.13/lib/Mail/Mailer.po=
d" target=3D"_blank">http://search.cpan.org/~<u></u>markov/MailTools-2.13/l=
ib/<u></u>Mail/Mailer.pod</a><span class=3D""><br>
<br>
On 11/19/2014 09:22 AM, Sergio Letuche wrote:<br>
</span><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-=
left:1px #ccc solid;padding-left:1ex"><span class=3D"">
ok this is what i asked, could a mail be sent without mailx been installed,=
<br>
<br>
thank you<br>
<br>
2014-11-19 16:19 GMT+02:00 PHILLIPS M.E. &lt;<a href=3D"mailto:m.e.phillips=
@durham.ac.uk" target=3D"_blank">[email protected]</a><br></span>
&lt;mailto:<a href=3D"mailto:[email protected]" target=3D"_blank">m=
.e.phillips@durham.<u></u>ac.uk</a>&gt;&gt;:<br>
<br>
=C2=A0 =C2=A0 Not sure exactly what you mean by not using a mailer.____<br>
<br>
=C2=A0 =C2=A0 __ __<br>
<br>
=C2=A0 =C2=A0 In our Perl scripts I tend to do:____<br>
<br>
=C2=A0 =C2=A0 __ __<br>
<br>
=C2=A0 =C2=A0 open (MAIL, &quot;|-&quot;, &#39;/bin/mailx&#39;, &#39;-s&#39=
;, $subject, @addresses)____<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|| die &quot;Failed to e-ma=
il report: $!\n&quot;;____<br>
<br>
=C2=A0 =C2=A0 print MAIL $report;____<br>
<br>
=C2=A0 =C2=A0 close MAIL;____<br>
<br>
=C2=A0 =C2=A0 __ __<br>
<br>
=C2=A0 =C2=A0 which relies on mailx being installed and able to send messag=
es.____<br>
<br>
=C2=A0 =C2=A0 __ __<span class=3D""><br>
<br>
=C2=A0 =C2=A0 I=E2=80=99m sure there are SMTP modules for Perl, and things =
like that which<br>
=C2=A0 =C2=A0 could do it all at socket level, but I wouldn=E2=80=99t see t=
hat as being<br>
=C2=A0 =C2=A0 easier necessarily. It depends on what control you have over =
your<br></span>
=C2=A0 =C2=A0 server.____<br>
<br>
=C2=A0 =C2=A0 __ __<br>
<br>
=C2=A0 =C2=A0 Matthew____<br>
<br>
=C2=A0 =C2=A0 __ __<br>
<br>
=C2=A0 =C2=A0 *From:*Sergio Letuche [mailto:<a href=3D"mailto:code4libuserx=
@gmail.com" target=3D"_blank">code4libuserx@gmail.<u></u>com</a><br>
=C2=A0 =C2=A0 &lt;mailto:<a href=3D"mailto:[email protected]" target=
=3D"_blank">code4libuserx@gmail.<u></u>com</a>&gt;]<br>
=C2=A0 =C2=A0 *Sent:* 19 November 2014 08:31<br>
=C2=A0 =C2=A0 *To:* <a href=3D"mailto:[email protected]" target=3D"_blank">=
[email protected]</a> &lt;mailto:<a href=3D"mailto:[email protected]" targe=
t=3D"_blank">[email protected]</a>&gt;<br>
=C2=A0 =C2=A0 *Subject:* send emails via perl____<br>
<br>
=C2=A0 =C2=A0 __ __<br>
<br>
=C2=A0 =C2=A0 hello,____<br>
<br>
=C2=A0 =C2=A0 __ __<span class=3D""><br>
<br>
=C2=A0 =C2=A0 we need to use the easiest solution, if possible just use a p=
erl<br>
=C2=A0 =C2=A0 module, to be able to send automated emails on an Ubuntu serv=
er. The<br>
=C2=A0 =C2=A0 scenario is this: we ran a cron job, and say we would like to=
 send a<br>
=C2=A0 =C2=A0 message after completion, to a certain for example gmail acco=
unt.<br>
=C2=A0 =C2=A0 The ideal would be to not use any mailer, is this possible? O=
r could<br></span>
=C2=A0 =C2=A0 you please suggest us the best - easiest approach?____<br>
<br>
=C2=A0 =C2=A0 __ __<br>
<br>
=C2=A0 =C2=A0 Thank you____<br>
<br>
<br>
</blockquote>
</blockquote></div><br></div>

--001a11c167785571350508370b0b--