Appy16 has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use warnings; use LWP::Simple; use Email::Send; use Email::Send::Gmail; use Email::MIME::Creator; use IO::All; my $url = "http://abcd.com/search?q=%22MB%22&t=blogs&f=csv"; my $file = "/Users/Abc/Desktop/MB.csv"; my $status = mirror($url,$file); die "Cannot retrieve $url" unless is_success($status); my $email = Email::MIME->create( header => [ From => 'abcd@gmail.com' To => 'abc1@gmail.com', Subject => 'ABCD', ], attributes => { filename =>"MB.csv", content_type =>"application/csv", disposition =>"attachment", Name =>"/Users/Abc/Desktop/MB.csv", }, body => io( "/Users/Abc/Desktop/MB.csv" )->all, ); my $sender = Email::Send->new( { mailer => 'Gmail', mailer_args => [ username => 'abcd@gmail.com', password => '1234qwerty', ] } ); eval { $sender->send($email) }; die "Error sending email: $@" if $@;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl script using cron
by Corion (Patriarch) on Mar 16, 2010 at 09:05 UTC | |
|
Re: Perl script using cron
by JavaFan (Canon) on Mar 16, 2010 at 10:54 UTC | |
|
Re: Perl script using cron
by ssandv (Hermit) on Mar 16, 2010 at 17:40 UTC | |
|
Re: Perl script using cron
by ahmad (Hermit) on Mar 17, 2010 at 02:00 UTC | |
by Appy16 (Sexton) on Mar 17, 2010 at 05:12 UTC |