Need to send a form content as Email.

Hi,<br />
I have been trying to create a form and send its contents as email. I also want the email content to be formatted the way I want it to look. Is this possible ?? <br />
<br />
Thanks,<br />
Vijaya<!--content-->Yes, but it to format it in HTML, you will need to use a server-side script (such as PHP, CGI, ASP or JSP) to send the email. It is possible to set the action attribute to mailto:[email protected], but no HTML formatting will be involved, and it will not work for users with Web-based email set as default (unless they've Download <!--more-->ed some sort of program that does that enables it). Also, it's best to send the form via enctype="text/plain" if you use the mailto: protocol.<br />
<br />
[J]ona<!--content-->Hi,<br />
Thanks a lot for your time. I did exactly what u said in ur mai. It sends a email but can u send me the code in asp or jsp (preferably) or cgi to format the text in the mail ?? <br />
<br />
Thanks,<br />
Vijaya<!--content-->I don't know ASP or JSP, as my host doesn't support either, but here is a script I made in CGI (Perl). You'll need to change a few variables to point to your sendmail and Perl executables, though... (param() contains the different field names.)<br />
<br />
<br />
#!/usr/local/bin/perl <br />
<br />
use CGI qw{:cgi};<br />
<br />
my $name = param('fn');<br />
my $name2 = param('ln'); <br />
my $email = param('em'); <br />
my $rating = param('rat');<br />
<br />
sub Mail<br />
{<br />
($to, $from, $subj, $body) = @_;<br />
$mailprog = "/usr/sbin/sendmail";<br />
open(MAIL, "| $mailprog -t ");<br />
print MAIL "To: $to\n";<br />
print MAIL "From: $from\n";<br />
print MAIL "Subject: $subj\n";<br />
print MAIL $body;<br />
print MAIL "\n";<br />
}<br />
<br />
Mail("you\@email.com", $email, "From your site", "You have just received a rating from someone. Here is their information:\n\nName: $name $name2\nEmail: $email\nRating of your site: $rating");<br />
<br />
print <<END; <br />
Content-Type: text/html\n\n <br />
<html><br />
<head><br />
<title>Test</title><br />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><br />
</head><br />
<body><p><br />
Name: <b>$name $name2</b><br><br />
Email: <b>$email</b><br><br />
Rating: <b>$rating</b><br />
</p><br />
</body></html><br />
END<br />
<br />
<br />
[J]ona<!--content-->I have the very same problem, but since I am new to programming and scripting, I did't quite understand the first part of your solution Jona. Where do you have to put the code above the html code. And know does the form summit anything?<br />
<br />
<br />
maybe my question is a bit basic :-)<br />
<br />
asbjoern<!--content-->The code I provided is Perl/CGI code which means it must be a .cgi or .pl script uploaded to a CGI-BIN folder on the server. If you do not have access to a server-side language, then you cannot use these scripts.<br />
<br />
[J]ona<!--content-->well thanks for your reply [J]ona, i found another bit simpler way to do it though (I understand it better anyway) it is a php file thats look like this in the body tag.One thing though is that I would like to put the emailadress typed by the user into the senderadress when i resive the mail. I just can't figure out???<br />
<br />
Asbjoern<br />
<br />
<br />
<br />
<form action="" medthod="post" ><br />
<p><br />
Navn <input name="textarea1" height="15" width="200"></p><br />
Email <input name="textarea2" height="15" width="150"><br />
<p><br />
Emne <select name="textarea3"><br />
<option value="ALLERGI" selected> Allergi<br />
<option value="BARSEL"> Barsel<br />
<option value="LEGETç’ž
 
Back
Top