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

Is there an option to send mail on Unix with a perl script? I looked at the manpage and documentation and do no see any options to use for attachments. Im using the -s for subject and including the text in "no_error.txt" into the email but need to attach a file to send with it. Sorry, I just posted the Win32:OLE, that works but I get a pop-up in Outlook(stating "A program is trying automatically send email on your behalf" that needs input with 'Yes' or 'NO' button) which doesnt automate my script since it needs intervention. Thanks in advance for your Perl or Unix wisdom. Heres the code I currently have:
`mailx -s GLS_FTP_TEST $email <no_error.txt`
Thanks again, Fuism

Replies are listed 'Best First'.
Re: Mail with Attachment in UNIX
by JediWizard (Deacon) on Sep 21, 2004 at 19:51 UTC

    You could look at Mail::Sender, it appears that it will do what you want.

    May the Force be with you
Re: Mail with Attachment in UNIX
by mifflin (Curate) on Sep 21, 2004 at 19:53 UTC
    MIME::Lite will also work for this
Re: Mail with Attachment in UNIX
by gmpassos (Priest) on Sep 22, 2004 at 01:28 UTC
    In any OS Mail::SendEasy:
    use Mail::SendEasy ; Mail::SendEasy::send( from => 'sender@foo.com' , to => 'recp@domain.foo' , subject => "MAIL Test" , msg => "The Plain Msg..." , anex => "file.zip" , ) ;

    Graciliano M. P.
    "Creativity is the expression of the liberty".

Re: Mail with Attachment in UNIX
by mifflin (Curate) on Sep 21, 2004 at 19:48 UTC
    try uuencode
    /usr/bin/uuencode file2attach file2attach | mailx ...
Re: Mail with Attachment in UNIX
by tradez (Pilgrim) on Sep 21, 2004 at 20:49 UTC
    I always like to just make txt files and pipe the output to sendmail


    Tradez
    Every official that comes in
    Cripples us, leaves us maimed
    Silent and tamed
    And with our flesh and bones
    He builds his homes