Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

what do I have to do to mail a file?

Posted on 2001-08-30
4
Medium Priority
?
151 Views
Last Modified: 2013-12-25
I got a a file that I need to mail upon completion of the the cgi execution.... any hints?
btw.... it's a form that gets filled out, stored in a file then I wanna mail it,
Kejtar
0
Comment
Question by:Kejtar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 1

Accepted Solution

by:
builder110697 earned 200 total points
ID: 6442521
If you need an email send as a result of a cgi execution...  However it is a little
more involved to send an attached file.  But, the Mail::Sendmail module will do it.
Check the manual when you download the module.

Here's a CGI script that accepts, verifies, and uses an email address...
You should be able to adapt...

    #!/usr/bin/perl

    use CGI qw( :standard :html );
    use CGI::Carp qw( fatalsToBrowser );
    use Mail::CheckUser qw( check_email );
    use Mail::Sendmail;

    $REQUIRED="<img src=/images/reqd_flag.gif>";

    if ( param('displayed_once_already') ne "" ) {
     if ( ! check_email( param('email')) ) {
       $redo_email = "<br><font color=red> Please re-enter email address</font>";
     }
    }

    if ( ( param('email') eq "" ) || ( $redo_email ne "" ) ) {
     print header()
         . start_form()
         . hidden( 'displayed_once_already', 'true' )
         . "Enter your email address: "
         . textfield('email',"", 50), "$REQUIRED $redo_email\n"
         . submit("press to continue")
         . endform()
         . "$REQUIRED Required field"
         . end_html();
    }
    else {
     my %mail = (
         To => param('email'),
         From => "me\@mysite.com",
         CC => "me\@mysite.com",
         Subject => "I have received your email address",
         Message => "Thankyou for visiting mysite.com\n\nSincerely,\nMe");
     sendmail( %mail ) || die $Mail::SendMail::error;

    }
0
 
LVL 1

Author Comment

by:Kejtar
ID: 6442633
ok.... unless I am missing it, there is nothing here about the attachements... if you could post a link that would be good...

Kejtar
0
 
LVL 1

Author Comment

by:Kejtar
ID: 6442634
ok.... unless I am missing it, there is nothing here about the attachements... if you could post a link that would be good...

Kejtar
0
 
LVL 1

Author Comment

by:Kejtar
ID: 6451291
This doesn't really lead me to where I want to go, but I am going to resolve it in another way.....

Kejtar
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

636 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