Solved

Form submittion possible in CGI??

Posted on 2003-12-02
7
472 Views
Last Modified: 2013-12-25
I've got a question (duh!) about CGI. I have a <FORM> on my website,but instead of submit button doing this: mailto:adres@email.com, I wonder if it is possible to send the info to an email adres, without having to really send the email (opening outlook express). For example: you press the button "submit" and the next screen says: Information sent! Is this possible in CGI?
0
Comment
Question by:Ducolo
[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
7 Comments
 
LVL 3

Assisted Solution

by:mrh30
mrh30 earned 100 total points
ID: 9860005
It's certainly possible.  In Perl you can use the MIME::Lite module to generate the appropriate headers within the CGI script and then automatically perform the mail.

Information about MIME::Lite is at http://search.cpan.org/~yves/MIME-Lite-3.01/lib/MIME/Lite.pm which includes examples of usage.  Basically you'll need to create appropriate headers for a plain text e-mail, then attach a portion of text (this can obviously be a string), and send the email out.  The CGI script can then proceed to the 'Information Sent' page.
0
 

Assisted Solution

by:Richoo
Richoo earned 100 total points
ID: 9860310
perhaps try the following http://scripts.cgi101.com/#lk1
0
 
LVL 7

Assisted Solution

by:Xxavier
Xxavier earned 200 total points
ID: 9862241
This looks like a client side problem, this will alert the user an e-mail is being sent but will not open outlook etc.

<form method="post" action="mailto:XYZ@abc.com?subject=Visitor Comments"
enctype="text/plain">
  <p><input type="text" name="Field1" size="20"><br>
  <input type="text" name="Field2" size="20"><br>
  <input type="text" name="Field3" size="20"><br>
   <select name="Field6" size="1">
      <option>Option1</option>
      <option>Option2</option>
      <option>Option2</option>
  </select><br>
  <input type="submit" value="Submit"> </p>
</form>


thre may be something of interest here for you as well

http://www.scriptarchive.com/formmail.html 
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Ducolo
ID: 9865041
I tried this in MIME:
--------
$msg = MIME::Lite->new(
             From     =>'ducorisselada@hotmail.com',
             To       =>'ducolo1979@hotmail.com',
             Subject  =>'Antwoordformulier autoverzekeringen',
             Type     =>'multipart/related'
             );
$msg->attach(Type => 'text/html',
             Data => qq{ <body>
                                                   Informatie die wordt meegegeven
                                                 </body> }
             );
$msg->send();
-------------

It does not work, wich is assumingly. Where do i put this script in my HTML?? Let's say i got this HTML:
-------
<form>
  <p><input type="text" name="Field1" size="20"><br>
  <input type="text" name="Field2" size="20"><br>
  <input type="text" name="Field3" size="20"><br>
   <select name="Field6" size="1">
      <option>Option1</option>
      <option>Option2</option>
      <option>Option2</option>
  </select><br>
  <input type="submit" value="Submit"> </p>
</form>
------

I wil wait for further answers. Xxavier, ur solution works, but if you don't have an outlook adres (or outlook), it won't work. So therefore I will try something else. Will it not work, I will use your answer.

0
 

Author Comment

by:Ducolo
ID: 9880891
I changed my mind. I will use CGI. I dowloaded :FormMail.cgi from Mat's Script Archive. You save this file in a /cg-bin/ map,is that right? And the form should read: <form action="/cgi-bin/FormMail.cgi"> </form>

There are also 3 variables you have to change.

- $mailprog = 'usr/lib/sendmail -i -t'
This is the location to your server's sendmail programme. How do i know what this is? Askmy provider?

The rest i know how to solve.
0
 
LVL 7

Assisted Solution

by:Xxavier
Xxavier earned 200 total points
ID: 9887298
"This is the location to your server's sendmail programme. How do i know what this is? Askmy provider?"

Basically yes, that is the way to do it. Xx
0
 
LVL 48

Accepted Solution

by:
Tintin earned 100 total points
ID: 9889709
Please DO NOT use Matt's formmail.  It is insecure, poorly written and not maintained.

Use the 100% compatible, secure, well written and maintained Formmail version from http://nms-cgi.sourceforge.net/
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
The viewer will learn how to dynamically set the form action using jQuery.
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…

749 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