473,397 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

How do I make my form a Form-to-Email?

Hi, i've been to your website a few times before and I really like it, and thought you might be able to help.

I'm building a website for a friend, and he wants a resume form (about 10-15 fields, all text entry boxes) to be sent to his email when the user hits Submit, i've looked and looked and just cant figure out how to do this. I've seen what I think are programs some sites are selling to do it, or remote websites that will do it for you, but I wanted to come here first to see if I could get this done myself.

I apprichiate any help you guys have,

Thanks
Dec 5 '05 #1
8 4099
Depending on what software you have available to you (PHP, ASP, Perl, etc.) You should be able to find FormMail in Perl or PHP.

FormMail is nice because you simply submit the form to the formmail.php file and it automatically sends the email.

Here is the PHP FormMail script I personally use: http://hotscripts.com/Detailed/29699.html
Dec 6 '05 #2
Ok, so i'd have to buy that program before I can get my form to send submits to my email?

Are there any free options when trying to get form to emails set up?

Thanks
Dec 6 '05 #3
Niheel
2,460 Expert Mod 2GB
http://www.tectite.com/vbforums/showthread.php?t=667

Scroll to the bottom, you can download it for from from the company's website.

Enjoy!
Dec 6 '05 #4
You can also download a free version here: http://www.dtheatre.com/scripts/formmail.php

That's the exact one I've used in the past. Works like a charm.
Dec 6 '05 #5
Well, i've downloaded both those links you guys gave me, but now im lost :|

When i try to open then they try and open like a picture and nothing comes up, and i've read I have to install them on my server? How/what is that, and once thats done, how do I code it into my form to send it to my email?

Thanks!
Dec 6 '05 #6
kamill
71
i have a solution for you......
you can send an email with hitting on submit buttoon.....


you have to require write code something like that..
values getted from your form
[PHP]$name=$_POST['name'];
$companynm=$_POST['companynm'];
$companyph=$_POST['companyph'];
$fax=$_POST['fax'];
$email=$_POST['email'];
$city=$_POST['city'];
$subject="Mail from Site..";
[/PHP]
mail id where you want to send mail
[PHP] $adminmail = "info@yourdomainnnn.com";[/PHP]
mail's msg in tabular format
[PHP] $msg ="<table border=1 width=\"100%\" cellspacing=0 cellpadding=7 bordercolor=\"#cccccc\">";
$msg .= "<tr height=27><td width=150 bgcolor=\"#eeeeee\" valign=middle><font face=verdana size=2> ";
$msg .= "Date </td><td><font face=verdana size=2 color=\"#666666\">$dat</td></tr>";


$msg .= "<tr height=27><td width=150 bgcolor=\"#eeeeee\" valign=middle><font face=verdana size=2> ";
$msg .= "Name </td><td><font face=verdana size=2 color=\"#666666\">$name</td></tr>";

$msg .= "<tr height=27><td bgcolor=\"#eeeeee\" valign=middle><font face=verdana size=2> ";
$msg .= "Email </td><td><font face=verdana size=2 color=\"#666666\">$from</td></tr>";

$msg .= "<tr height=27><td bgcolor=\"#eeeeee\" valign=middle><font face=verdana size=2> ";
$msg .= "Company Name </td><td><font face=verdana size=2 color=\"#666666\">$companynm</td>";

$msg .= "</tr></table>";
$from = "$name<$from>";

[/PHP]
define header
[PHP] $headers = "Content-type: text/html; charset=iso-8859-1\r\n";
[/PHP]
set SMTP
[PHP] ini_set("SMTP", "info.yourdomainnn.com");
[/PHP]
then last...........
[PHP] mail($email, $subject, $msg, "From:$from\n".$headers);[/PHP]
Jan 8 '07 #7
ronverdonk
4,258 Expert 4TB
A nice example by Zakir Hossain:
Name=Easy Form Mailer
Version=1.5
Date= November 14, 2006
Developer=Md. Zakir Hossain (Raju)
Email=rajuru(at)gmail(dot)com
URL=http://www.rajuru.xenexbd.com
License: LGPL

File SAMPLE.PHP
[html]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-us">
<title>Form Submission</title>
</head>
<body>
<hr>
<form action="mailer.php" method="POST" enctype="multipart/form-data">
<h2>Form Submission Sample</h2>
<p>Make up a username:<br>
<input type="text" size="25" maxlength="256" name="__Username"> -- <em>you
can use mixed case</em><br>
Make up a password:<br>
<input type="password" size="25" maxlength="256" name="__Password"> -- <em>
help keep this private!</em><br>
Enter password again:<strong><br>
</strong>
<input type="password" size="25" maxlength="256" name="__PasswordVerify"> --
<em>for verification</em><br>
Enter e-mail address:<strong><br>
</strong><input type="text" size="25" maxlength="256" name="__EmailAddress">
-- <em>if you have one</em></p>
<p><input type="text" size="25" maxlength="256" name="Firstname"> - First
Name</p>
<p><input type="text" size="25" maxlength="256" name="Lastname"> - Last Name</p>
<h2><input type="submit" value="Register Me">
<input type="reset" value="Clear Form"></h2>
<input type="hidden" name="Email_Recipient" value="rajuru@gmail.com">
<input type="hidden" name="Email_Sender" value="test@gmail.com">
<input type="hidden" name="Email_Subject" value="Membership Request">
<input type="hidden" name="Email_Success" value="Request Submitted, thanks for your time">
<input type="hidden" name="Email_Failure" value="An unknown error occured while submitting your form.">
<input type="hidden" name="Return_Url" value="<?php echo $_SERVER['HTTP_REFERER'];?>">
</form>
<hr>
</body>
</html>
[/html]
FILE MAILER.PHP:
[php]
<?php
/*
Name=Easy Form Mailer
Version=1.5
Date= November 14, 2006
Developer=Md. Zakir Hossain (Raju)
Email=rajuru(at)gmail(dot)com
URL=http://www.rajuru.xenexbd.com
License: LGPL
I appreciate the email's last credit line but not mandatory. A thank is highly deserved
*/
print_r($_POST);

//check for 3 required fields, these fields are made with Case-sensitivity
if(empty($_POST['Email_Recipient'])) die("No Email Recipient");
if(empty($_POST['Email_Sender'])) die("No Email Sender");
if(empty($_POST['Email_Subject'])) die("No Email Subject");

$to=$_POST['Email_Recipient'];
$from=$_POST['Email_Sender'];
$subject=$_POST['Email_Subject'];
unset($_POST['Email_Recipient']);
unset($_POST['Email_Sender']);
unset($_POST['Email_Subject']);


//success message, you can define one with hidden field. hidden field name must be "Email_Success"
if(!empty($_POST['Email_Success'])) {
$success=$_POST['Email_Success'];
} else {
$success= "Form submitted Successfully";
}
unset($_POST['Email_Success']); //unset this variable

//Failure message, you can define one with hidden field. hidden field name must be "Email_Failure"
if(!empty($_POST['Email_Failure'])){
$failure=$_POST['Email_Failure'];
} else {
$failure="Form submission failed. Sorry for this inconvenience";
}
unset($_POST['Email_Failure']); //unset this variable

//set return url after successfully completing submission
if(!empty($_POST['Return_Url'])){
$returnurl=$_POST['Return_Url'];
} else {
$returnurl=$_SERVER['HTTP_REFERER'];
}
unset($_POST['Return_Url']); //unset return url

$msg="";

foreach ($_POST as $Field=>$Value){
if(substr($Field,0,2)=="__"){ //field started with double underscore which means they are required fields
if(empty($Value)){
die("You must enter ".substr($Field,2)."<br/><a href=\"javascript:history.go(-1)\">Go Back</a>"); //cancel script
} else {
$msg .= substr($Field,2) .": <b>". $Value."</b>"; //strip first two character as they are double underscore
$msg .="<br>";
}
} else {
$msg .= $Field .": <b>". $Value."</b>";
$msg .="<br>";
}
}
$msg.= "<br/><br/>Script by <a href=\"http://www.rajuru.xenexbd.com\">Md. Zakir Hossain (Raju)</a>";
/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1 \r\n";
/* additional headers */
$headers .= "To: $to \r\n";
$headers .= "From: $from \r\n";
$headers .= "Subject: $subject \r\n";

/* and now mail it */
if (@mail($to,$subject, $msg, $headers)) {
echo "<b>$success</b><br/><a href=\"$returnurl\">Go Back</a>";
} else {
echo "$failure <br/><a href=\"javascript:history.go(-1)\">Go Back</a>";
}
?>
[/php]
FILE README.TXT
Expand|Select|Wrap|Line Numbers
  1. Name=Easy Form Mailer
  2. Version=1.5
  3. Date= November 14, 2006
  4. Developer=Md. Zakir Hossain (Raju)
  5. Email=rajuru(at)gmail(dot)com
  6. URL=http://www.rajuru.xenexbd.com
  7. License: LGPL
  8. I appreciate the email's last credit line but not mandatory. A thank is highly deserved 
  9.  
  10.  
  11. Overview:
  12. Using this script anyone can easily get form result to his/her mailbox. You can use this script for any form 2 mail purpose.
  13. You can define mandatory fields without a single line of code. Just put __ (double underscore) before field name
  14. You can show custom message on success or failure of submission
  15.  
  16.  
  17. How to Use:
  18. 1. Create a new page and design form.
  19. 2. You can use as many fields as you wish
  20. 3. put __ (double underscore) before the name of any compolsory fields. suppose username field is mandatory. so its name should be __username
  21. 4. Create at least three hidden fields as below
  22.  
  23. Name                        Value
  24. ------                        ----------------------------------------------
  25. Email_Recipient            your email address where you wish to receive email
  26. Email_Sender            your mail subject
  27. Email_Subject            send address, you can use an email box for visitors to give his email address        
  28.  
  29. 5. Optionally you can create 3 more hidden fields
  30. Name                        Value
  31. ------                    ---------------------------------------------
  32. Email_Success                Message after mail sending success
  33. Email_Failure                Message if mail sending fails
  34. Return_Url                    The address where user should be back after successful submission
  35.  
  36. Note: These 6 fields are case-sensitive
  37.  
Ronald :cool:
Jan 8 '07 #8
[quote=Tracker3000]Well, i've downloaded both those links you guys gave me, but now im lost :|

Hey Tracker3000, a bit late now, but did you get this Perl CGI Formmail problem resolved in the end?.

Gazza
Jan 18 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Krista | last post by:
Hi , hope u guys can help me out ... Can i do like that in php file? <form....> (doesnt work) <form....> ............ ...
2
by: CK | last post by:
Hi All, I encounter one problem with my asp scrits. In my HTML file, I have two forms. Which is <form name="form1".....> </form> and <form name = "form2...> and using Post Method. When I use the...
4
by: Steve | last post by:
Hi everyone, I have a test page. When I press the button, it bring form.html, which is fine. When I press Enter key in the textbox, it gives me an error saying this.form.cmd is not an object. ...
4
by: ianv2 | last post by:
Hi I have the following form that I need advanced validation on, I would appreciate any help please. How can I validate the form so that the user has to select an option from the select box...
3
by: Tom | last post by:
Hi, I have a web page which has server side include for top, left, main and bottom.aspx pages. In the left.aspx, there is a login web control which has a pair of form tags. In the main...
3
by: Cc | last post by:
does event onload mean form already loaded or before loaded? I make a form and I inherit that form on another form, when I run, it execute the process on the parent form without showing the form on...
10
by: Partha Protim Roy | last post by:
Hello, My problem is: I got a Login form, so once the user enter vaild Username & Password another form opens. How do I close the login form?
3
by: Bob | last post by:
I haver a user login form (winforms app using vs2005 in VB.NET). After succesfull validayion of user I want to open a first form and close the loging form that was used, If I write If...
5
by: mareeus | last post by:
Hi, Let's say we have the following html code (a body with some forms): <html> <head> </head> <body> <form name="form1" action="#">
1
by: Martijn Mulder | last post by:
In this tiny program I address a Disposed() Form object. I expect an exeption but don't get one. What is the status of a Disposed() Control? using System; using System.Windows.Forms; class...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.