Solved

Form submittion possible in CGI??

Posted on 2003-12-02
7
481 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
Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

 

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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

707 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