Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Perl Email attchment using Sendmail with out nay perl Modules like (MIME::Lite .etc )

by McA (Curate)
on Oct 15, 2012 at 12:03 UTC ( #999075=note: print w/ replies, xml ) Need Help??


in reply to Perl Email attchment using Sendmail with out nay perl Modules like (MIME::Lite .etc )

Hi

If you want to build a mail with attachment you have to build a valid MIME-message. That is not trivial. That's why there are so many big packages at CPAN. But if you really have the need, than I would suggest to look at the cli tool mail of your OS. The newer versions are able to handle attachments.

So my proposal:

my $rc = system("echo '' | mail -s 'Test' -a $file $to");

Best regards
McA


Comment on Re: Perl Email attchment using Sendmail with out nay perl Modules like (MIME::Lite .etc )
Select or Download Code
Re^2: Perl Email attchment using Sendmail with out nay perl Modules like (MIME::Lite .etc )
by ppnair (Initiate) on Oct 15, 2012 at 12:29 UTC

    Thank you

Re^2: Perl Email attchment using Sendmail with out nay perl Modules like (MIME::Lite .etc )
by ppnair (Initiate) on Oct 16, 2012 at 12:03 UTC

    Getting below error when i try mail command

    mail: invalid option -- a Usage: mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr .. +. [-- sendmail-options ...] mail [-iInNv] -f [name] mail [-iInNv] [-u user]

      That's the reason I wrote: ... the newer versions ...

      So, in this special case you're out of luck. Is there a reason you can't install MIME::Lite as suggested by another monk here?

      Best regards
      McA

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://999075]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (19)
As of 2014-09-16 12:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (18 votes), past polls