Solved

what do I have to do to mail a file?

Posted on 2001-08-30
4
140 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
  • 3
4 Comments
 
LVL 1

Accepted Solution

by:
builder110697 earned 100 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

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

Suggested Solutions

Title # Comments Views Activity
How to silent print from safari browser 6 135
Powershell / new-object PSObject rows 2 102
Sed question 2 46
scripting, exchange 35 40
This tutorial will discuss the log-in process using WhizBase. In this article I assume you already know HTML. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you might look at some of my other articles abo…
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 tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

705 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

19 Experts available now in Live!

Get 1:1 Help Now