Solved

How to send attachment as zip file in perl?

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
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.:
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

747 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now