perlmad has asked for the wisdom of the Perl Monks concerning the following question:

Hi All,

Now I am trying MIME::Lite module and I have a doubt on sending email along with file and bcc content

Code that i have tried

if($from ne "" && $to ne ""){ my $content= MIME::Lite->new( From => $from, To => $to, Cc => $cc?$cc:"", Subject => $subject?$subject:"No Subject", Data => $content?$content:"No Content", Bcc => $bcc?$bcc:"" ); $content->attach( Type => 'TEXT', Data => 'Here is the text for testing' ); $content->attach( Type => 'FILE', path => 'path', Filename=> 'text.txt', Disposition =>'attachment' ); }

I couldn't add "BCC" and "File" with the email , Any Suggestion???

Replies are listed 'Best First'.
Re: Email Sending issue with the file
by Corion (Patriarch) on May 18, 2016 at 07:00 UTC

    Note that Path needs to have an upper-case P, not a lowercase p. Its value needs to be the absolute path and filename of the file you want to attach to the mail.

    What is the value of $bcc? How do you verify that it doesn't work?

      Thanks it's working and bcc is just a email address same as cc content in emil, my doubt is how can i add bcc content in perl script?

        Your approach of

        Bcc => $bcc,

        should just work. Note that Bcc headers don't show up in the email itself.