Solved

How to send attachment as zip file in perl?

Posted on 2009-04-15
3
338 Views
Last Modified: 2013-11-17
Hi,
I have this part of code where I need to enable sending file as zip attachment in perl.

if ($func =~ /email (.*)/) {
      $send_email = 1;
      $subject = "Mail from  Servers";
      $attach = 1;
        @RECIP = split /,/, $1;
#      push @RECIP, $1;

      while (<STDIN>) {
            $out .= $_;      
      }

Regards,
Naseer

if ($func =~ /email (.*)/) {
	$send_email = 1;
	$subject = "Mail from  Servers";
	$attach = 1;
        @RECIP = split /,/, $1;
#	push @RECIP, $1;
 
	while (<STDIN>) {
		$out .= $_;	
	}

Open in new window

0
Comment
Question by:naseer6679
3 Comments
 
LVL 13

Assisted Solution

by:marchent
marchent earned 150 total points
ID: 24147552
0
 
LVL 39

Assisted Solution

by:Adam314
Adam314 earned 150 total points
ID: 24148339
The code you posted does not send the e-mail.  You could use the MIME::Lite module to handle this:
    http://search.cpan.org/~rjbs/MIME-Lite-3.024/lib/MIME/Lite.pm
0
 
LVL 48

Accepted Solution

by:
Tintin earned 200 total points
ID: 24151859
MIME::Lite is the usual way most people use for sending attachments.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
can't umount nfs share after server goes offline... 4 98
How to clone solaris 10 machine 33 170
lunix and unix command 21 116
Perl Snippet to Parse String 1 36
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question