Solved

send email with input data

Posted on 2011-03-08
5
200 Views
Last Modified: 2012-05-11
Need a simple html form to create an email with info to send to me. Right now if the user does not have an email client, it pops up with a wizard. Any suggestions? Thanks

<FORM method="post" action="mailto:***@gmail.com" enctype="text/plain">  
Please Enter Your Name:<br />
                <input size="40" name="realname" />
                <br />
                <br />
                Please Enter Your Email Address:<br />
                <input size="40" name="email" />
                <br />
                <br />
                Please Enter Your Phone Number:<br />
                <input size="40" name="phone" />
                <br />
                <br />
                Please Enter Referral’s Name:<br />
                <input size="40" name="Referralname" />
                <br />
                <br />
                Please Enter Referral’s Email Address:<br />
                <input size="40" name="email" />
                <br />
                <br />
                Please Enter Referral’s Phone Number:<br />
                <input size="40" name="phone" />
                <br />
                <br />
                <input value="Submit" type="submit" />
                <input value="Reset" type="reset" />
</form>
0
Comment
Question by:wilcor14
  • 2
  • 2
5 Comments
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 167 total points
Comment Utility
That would be normal operation for your situation.  Most of the time, we create a second page in a server programming language like PHP or ASP that send the email from the web server.  What you have above is all you can do with just HTML.  Do you know what server languages your web server supports?
0
 
LVL 5

Expert Comment

by:mayankagarwal
Comment Utility
use the following code (ASP)
Dim Mail
set Mail=server.createobject("CDO.Message")
Mail.From = xxxx@xxx.xxx
Mail.To=xxxxxxx@xxxxx.xxxxx
Mail.Subject = "Subject"
Mail.TextBody = "BODY"

Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="relay-hosting.secureserver.net"
Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") =25
Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/tpauthenticate") =1
Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="my email login eg email@domain.com"
Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="my email password"
Mail.Configuration.Fields.Update
'Mail.Send
set Mail=nothing
%>
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
That's nice but "relay-hosting.secureserver.net" is specific to Godaddy hosting.  You would need to put in your own SMTP mail server if you use that code.
0
 
LVL 4

Assisted Solution

by:WhiteSeed
WhiteSeed earned 333 total points
Comment Utility
i you can try with php code.
make 2 page 1 whit this code:
Question: Need a simple html form to create an email with info to send to me. Right now if the user does not have an email client, it pops up with a wizard. Any suggestions? Thanks

<FORM method="post" action="mailto:***@gmail.com" enctype="text/plain">  
Please Enter Your Name:<br />
                <input size="40" name="realname" />
                <br />
                <br />
                Please Enter Your Email Address:<br />
                <input size="40" name="email" />
                <br />
                <br />
                Please Enter Your Phone Number:<br />
                <input size="40" name="phone" />
                <br />
                <br />
                Please Enter Referral’s Name:<br />
                <input size="40" name="Referralname" />
                <br />
                <br />
                Please Enter Referral’s Email Address:<br />
                <input size="40" name="email" />
                <br />
                <br />
                Please Enter Referral’s Phone Number:<br />
                <input size="40" name="phone" />
                <br />
                <br />
                <input value="Submit" type="submit" />
                <input value="Reset" type="reset" />
</form>

Open in new window

and 1 page whit this code
<?php
 $to = $_POST['email']  //the name of the var e-mail address
 $subject = "User Info"; // a subject for the email
//write your message betwen "  "   \n go to the next line
 $body = "Hi,\n\n Admin    
,\n RealName = $_POST['realname'] \n  PhoneNumber =$_POST['phone']
\n Referralname = $_POST['Referralname'] , ecc...";  
 if (mail($to, $subject, $body)) {
   echo("<p>Message successfully sent!</p>");
  } else {
   echo("<p>Message delivery failed...</p>");
  }
 ?>

Open in new window

0
 
LVL 4

Assisted Solution

by:WhiteSeed
WhiteSeed earned 333 total points
Comment Utility
in the first page code that i've write before delete:
<FORM method="post" action="mailto:***@gmail.com" enctype="text/plain">  

Open in new window

and replace
<form action="SECONDPAGENAME.php" method="POST" enctype="multipart/form-data">

Open in new window

0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

763 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now