Solved

send email with input data

Posted on 2011-03-08
5
204 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
[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
  • 2
  • 2
5 Comments
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 167 total points
ID: 35071533
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
ID: 35071561
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 83

Expert Comment

by:Dave Baldwin
ID: 35071615
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
ID: 35071667
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
ID: 35071704
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Telerik RadEditor Control Save 8 39
Presenting my portfolio on the web? 11 53
How to send a javascript array via AJAX (jquery)? 3 42
Undefined variable with $_POST in PHP 5 39
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

738 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