Is this possible?

  • gladden
  • Beginner
  • Beginner
  • gladden
  • Posts: 44

Post 3+ Months Ago

Is there a program or a way to produce formatted email messages from an html form? I did a quick search but couldn’t find this topic discussed anywhere.

I’m working with someone who insists to have an html form instead of an email for people to contact him. He’s basically telling me that he doesn’t want to read emails, but wants to have formatted responses from people and he’s given me this site as an example:
http://www.lwgconsulting.com/AssignFile.htm
I don’t know what the people who did the above site do with the form, my guess is that they do what everybody does, parse and save the information in a database. But I could be wrong. Can someone tell me if there are ways that an html format can create a formatted email without additional server side programming?

I’d appreciate your suggestion or input

Thanks in advance
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Posts: 5149
  • Loc: SC-USA

Post 3+ Months Ago

You need some simple scripting help. Go here.

//moved
  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Posts: 5149
  • Loc: SC-USA

Post 3+ Months Ago

First of all you need to determine what environments are available for you to use. (PHP, ASP, Perl, etc.)
  • jkowalski
  • Born
  • Born
  • jkowalski
  • Posts: 1

Post 3+ Months Ago

<form method="POST" action="--WEBBOT-SELF--">
<!--webbot bot="SaveResults" S-Email-Format="TEXT/PRE" S-Email-Address="SendTo@MailServer.com" B-Email-Label-Fields="TRUE" B- Email-ReplyTo-From-Field="TRUE" S-Email ReplyTo="ReplyTo@mailserver.com" B-Email-Subject-From-Field="FALSE" S-Email-Subject="Test Message" S-Builtin-Fields -->

<p><input type="text" name="FieldName1" size="20"></p>
<p><input type="checkbox" name="FieldName2" value="ON"></p>
<p>&nbsp;</p>
<p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
<p>&nbsp;</p>
</form>
  • gladden
  • Beginner
  • Beginner
  • gladden
  • Posts: 44

Post 3+ Months Ago

Wow, thank you all

When I posted this question I really didn’t think it would be possible without some server side programming. I’m using php as my server but I was thinking that I would need at least three perl programs, and a database.

I’m going to try the piece of code by jkowalski to check it out, thank you jkowalski . If anyone else has any advice please let me know, thanks a lot.
  • gladden
  • Beginner
  • Beginner
  • gladden
  • Posts: 44

Post 3+ Months Ago

Hi jkowalski,

What is WEBBOT? I googled for it and found several different definitions and applications? It’s the first time I hear about it so I cannot even begin to figure out what I’m looking for. Could you please direct me to a site where I may read more about it?

Thanks.
  • gladden
  • Beginner
  • Beginner
  • gladden
  • Posts: 44

Post 3+ Months Ago

Hi all,

I’m going back to my question again, is there any way to take an html form and convert it into some sort of printable document with all the formatting, without writing server side programs? The only way I know to do this by writing some perl, programs for parsing of the initial html document, saving the information and producing the formatted report/document. I don’t actually mind writing the programs but I need to know if I’m correct and this is the only way to go.

Can someone please confirm this for me or suggest where I can get more information on the topic? I couldn’t find any helpful information through google, probably looking in the wrong categories.

Thanks in advance.
  • GT500Shlby
  • Guru
  • Guru
  • User avatar
  • Posts: 1205
  • Loc: Philadelphia, PA

Post 3+ Months Ago

You want a simple CGI script. I would suggest reading a tutorial on PERL/CGI scripts and web-based forms.

Try: http://www.jmarshall.com/easy/cgi/
Also: http://www.cgi101.com/book/ <-- I like this one

To go directly to what you want: http://www.cgi101.com/book/ch4/text.html

It's titled "Processing Forms and Sending Mail".

Perl is quite simple and their is a plethora of resources available to learn it.
http://www.google.com/search?hl=en&lr=& ... +Tutorials

If you need more specific PERL help please feel free to E-mail me.
  • gladden
  • Beginner
  • Beginner
  • gladden
  • Posts: 44

Post 3+ Months Ago

Thanks,

Then I guess I can conclude that the only way to do this is by additional server side programming. Thank you for the links.
  • GT500Shlby
  • Guru
  • Guru
  • User avatar
  • Posts: 1205
  • Loc: Philadelphia, PA

Post 3+ Months Ago

I guess you could possibly do it in Javascript, but Perl is easy.

Write a simple CGI/PERL script and put it in your cgi-bin directory. Then have the html form POST to it. Quite simple indeed.
  • GT500Shlby
  • Guru
  • Guru
  • User avatar
  • Posts: 1205
  • Loc: Philadelphia, PA

Post 3+ Months Ago

This should be of some help:

The html file:
Code: [ Select ]
<html>
 <head>
  <title>My WebForm</title>
 </head>
 <body>
  <form id="myWebFrm" action="/cgi-bin/myform.pl" method="post">
   Fav Color: <input type="text" name="color" />
   <input type="submit" value="Submit" />
  </form>
 </body>
</html>
  1. <html>
  2.  <head>
  3.   <title>My WebForm</title>
  4.  </head>
  5.  <body>
  6.   <form id="myWebFrm" action="/cgi-bin/myform.pl" method="post">
  7.    Fav Color: <input type="text" name="color" />
  8.    <input type="submit" value="Submit" />
  9.   </form>
  10.  </body>
  11. </html>


The perl file:
Code: [ Select ]
#!/usr/bin/perl
use CGI qw(:standard);
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);

print header;
print start_html("Your Submission Worked!");

my ($color) = param('color');

if ( $color eq "" ) {
 print "<h1>Please Enter Your Favorite Color</h1>\n";
} else {
$ENV{PATH} = "/usr/sbin";
open (MAIL, "|/usr/sbin/sendmail -oi -t") or &oops ( "Can't fork for Sendmail: $!");

print MAIL "To: foo@bar.com\n";
print MAIL "From: formSubmitter@myform.com\n";
print MAIL "Subject: Form Submission\n";
print MAIL "color = $color\n";
print MAIL "\n.\n";
close MAIL or &oops ( "Error with Sendmail: $!" );

print "<h1>Everything Worked</h1>\n";
}

print end_html;
exit;

sub oops {
 print "<h1>An Error Occurred</h1>\n";
 print "<h2>@_!</h2>\n";
}
  1. #!/usr/bin/perl
  2. use CGI qw(:standard);
  3. use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
  4. print header;
  5. print start_html("Your Submission Worked!");
  6. my ($color) = param('color');
  7. if ( $color eq "" ) {
  8.  print "<h1>Please Enter Your Favorite Color</h1>\n";
  9. } else {
  10. $ENV{PATH} = "/usr/sbin";
  11. open (MAIL, "|/usr/sbin/sendmail -oi -t") or &oops ( "Can't fork for Sendmail: $!");
  12. print MAIL "To: foo@bar.com\n";
  13. print MAIL "From: formSubmitter@myform.com\n";
  14. print MAIL "Subject: Form Submission\n";
  15. print MAIL "color = $color\n";
  16. print MAIL "\n.\n";
  17. close MAIL or &oops ( "Error with Sendmail: $!" );
  18. print "<h1>Everything Worked</h1>\n";
  19. }
  20. print end_html;
  21. exit;
  22. sub oops {
  23.  print "<h1>An Error Occurred</h1>\n";
  24.  print "<h2>@_!</h2>\n";
  25. }


Hope this works! :lol:
  • gladden
  • Beginner
  • Beginner
  • gladden
  • Posts: 44

Post 3+ Months Ago

Wow cool thanks :)

Post Information

  • Total Posts in this topic: 12 posts
  • Users browsing this forum: No registered users and 63 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.