in reply to PERL MIME:LITE

BTW, you noticed this?

"MIME::Lite is not recommended by its current maintainer. There are a number of alternatives, like Email::MIME or MIME::Entity and Email::Sender, which you should probably use instead. MIME::Lite continues to accrue weird bug reports, and it is not receiving a large amount of refactoring due to the availability of better alternatives. Please consider using something else."

See MIME::Lite.

Regards, Karl

«The Crux of the Biscuit is the Apostrophe»

Replies are listed 'Best First'.
Re^2: PERL MIME:LITE
by Bhaskar Patel (Initiate) on Jan 23, 2014 at 18:32 UTC

    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 $@;
      "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