Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Email Sending issue with the file

by perlmad (Sexton)
on May 18, 2016 at 06:47 UTC ( [id://1163293]=perlquestion: print w/replies, xml ) Need Help??

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1163293]
Approved by beech
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2024-04-23 17:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found