Re: How attach files and send mails on perl????
[email protected] (Rob Dixon)
| Newsgroups | perl.beginners |
|---|---|
| Message-ID | <[email protected]> |
Armin Garcia wrote:
> hi !!!
>
> thanks for your help ....
>
>
> And im sorry Rob, but this code its not mine ... but thanks, i never see
> in my mind how you minimize that code, really thanks for your help, and
> i found another module named MIME::Lite, its more easy to use, and
> attach files, and do another things very quickly and easy ....
>
> But Thank so much
>
> I include the code that i'm writting in this time (i mean the time when
> i was post this message and found this module, and read your replys), i
> hope my code are more visible :D
>
>
> #!/usr/bin/perl
As I said, always
use strict;
use warnings;
> use MIME::Lite;
>
> $msg = new MIME::Lite;
my $msg = new MIME::Lite;
and so on
> $msg->build(
> Type => 'x-gzip',
> Path => "gzip < /home/agarcia/HoneyClient/backup-2008-06-11.tar |",
> ReadNow => 1,
> Filename => "SomeFile.tgz"
> );
>
> $msg->add(From => "agarcia\@server1.com.mx <http://server1.com.mx>");
> $msg->add(To => "bec_agarcia\@server2.com.mx <http://server2.com.mx>");
> $msg->add(Subject => "Test attach files");
>
> ### Send the Message
> #MIME::Lite->send('smtp', honeyclient.seguridad.unam.mx
> <http://honeyclient.seguridad.unam.mx>, Timeout=>60);
> $msg->send;
>
>
> thanks for all and see you soon....
Good luck.
Rob