Solved

How to send attachment as zip file in perl?

Posted on 2009-04-15
3
327 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
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 navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

770 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