in reply to Re: PERL MIME:LITE
in thread PERL MIME:LITE

Hi Karl,

Below is the code I tried for single user that's fine but attachment and multiple user when I tried it throws error.Please suggest me what should I try now. Thanks in advance
#!/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 = "https://www.google.co.in/?gws_rd=cr&ei=VJzjUrT3LMaPrgeQ +5oHQDg/csv"; my $file = "C:\Users\Administrator\Desktop\a.csv"; my $status = mirror($url,$file); die "Cannot retrieve $url" unless is_success($status); my $url1 = "https://www.google.co.in/?gws_rd=cr&ei=VJzjUrT3LMaPrge +Q5oHQDg/csv"; my $file1 = "C:\Users\Administrator\Desktop\a.csv"; my $status1 = mirror($url1,$file1); die "Cannot retrieve $url" unless is_success($status1); my $email = Email::MIME->create( header => [ From => 'abc@gmail.com', To => 'abc@gmail.com', Subject => 'Test Mail', Message => ' Hi , How are you? Test mail please ignore. Thanks, ', CC => 'abc@gmail.com' ], ); attributes => [ { filename =>"a.csv", content_type =>"application/csv", disposition =>"attachment", Name =>"C:\Users\Administrator\Desktop\a.csv", }, body => io( "C:\Users\Administrator\Desktop\a.csv" )->all, { filename =>"a.csv", content_type =>"application/csv", disposition =>"attachment", Name =>"C:\Users\Administrator\Desktop\a.csv", }, body => io( "C:\Users\Administrator\Desktop\a.csv" )->all, ], ); my $sender = Email::Send->new( { mailer => 'Gmail', mailer_args => [ username => 'abcgmail.com', password => 'abcd0000', ] } ); eval { $sender->send($email) }; die "Error sending email: $@" if $@;

Replies are listed 'Best First'.
Re^3: PERL MIME:LITE
by karlgoethebier (Abbot) on Jan 23, 2014 at 19:09 UTC
    "Could you please explain how..."

    I'll try. I assume you use Active State Perl, right?

    If so, please see this instructions.

    Else give some feedback/ask again.

    Best regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

      Hi Karl,

      Currently I am using Strawberry perl. Please tell me how can I use it for sending mail to multiple recipient. I have already attached the code.

      Thanks a ton in advance