Solved

How to send attachment as zip file in perl?

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
reinstall 1 84
need to remove or skip  grub protection password in ubuntu on boot time 2 78
perl getopt long help 34 70
Log File Creation with Header and Footer 17 126
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
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…

839 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