954,595 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Email Form ?

Hi all im looking for a simple script that just has a single form where someone can enter their email address and the form will send that address to my email account , like "Subscribe to Newsletter" style thing...

Thanks all

RiverKqj
Light Poster
37 posts since Oct 2006
Reputation Points: 10
Solved Threads: 0
 

try this

<form action="mailto:you@yourdmainhere.com" method="post" enctype="text/plain" >
FirstName:<input type="text" name="FirstName">
Email:<input type="text" name="Email">
<input type="submit" name="submit" value="Submit">
</form>
Inny
Posting Whiz in Training
293 posts since Oct 2005
Reputation Points: 11
Solved Threads: 6
 

For that you need to know a server-side such as ASP or PHP. However you can also do it with JavaScript, but it depends upon clients configuration, not safe and not recommended. So use either ASP or PHP.

See this threads

http://www.daniweb.com/techtalkforums/thread58133.html

Or try using these...
http://w3schools.com/asp/asp_send_email.asp
http://w3schools.com/php/php_mail.asp
http://w3schools.com/php/php_secure_mail.asp

vishesh
Nearly a Posting Virtuoso
1,381 posts since Oct 2006
Reputation Points: 85
Solved Threads: 42
 

Vishesh, your probably right, but for the sake of learning please explain whjats wrong with my suggestion above? It does what he wants no?

Inny
Posting Whiz in Training
293 posts since Oct 2005
Reputation Points: 11
Solved Threads: 6
 

No, it doen't do what he wants. The thing you have given just draws a form, which just gets inputs and do nothing else. It doent mails that data to you or else... Its just HTML. To make it work you will have to embed a server side script with it.

For doing that you need to learn a server side such as ASP, PHP, CGI etc... Server side means that all the processing would be done in server not on clients computer.

If you want to learn a server side, you may refer to several resources on web... I recommend PHP!

www.w3schools.com
www.asptutorials.info
www.phptutorials.info

vishesh
Nearly a Posting Virtuoso
1,381 posts since Oct 2006
Reputation Points: 85
Solved Threads: 42
 

my apology, something like this will serve you

<FORM ACTION="http//someserver/cgi-bin/formmail.pl" METHOD="POST">

Name: <INPUT TYPE="text" NAME="Name" VALUE="" SIZE="25" MAXLENGTH="50"> <BR>

   Email: <INPUT TYPE="text" NAME="Email" VALUE="" SIZE="25" MAXLENGTH="50"><BR>

   <INPUT TYPE="CHECKBOX" NAME="subscribe" CHECKED> Subscribe me to the News letter <BR>

   Format of the Email:<BR>
   <INPUT TYPE="radio" NAME="format" VALUE="html" CHECKED> HTML<BR>
   <INPUT TYPE="radio" NAME="format" VALUE="text"> Plain Text<BR>

   Type of subscription you want:<BR>
   <SELECT NAME="type">  
     <OPTION VALUE="standard"> Standard - FREE
     <OPTION VALUE="prof"    > Professional - Paid
   </SELECT>    <BR>

   Comments to the editor:<BR>
   <TEXTAREA NAME="comments" ROWS="7" COLS="30"></TEXTAREA>

   <input type="hidden" name="to" value="you@somemail.com">


   <BR>
   <INPUT TYPE="SUBMIT" NAME="submit" VALUE="Sign Me Up!">
</FORM>
Inny
Posting Whiz in Training
293 posts since Oct 2005
Reputation Points: 11
Solved Threads: 6
 

No, it will also not work. It will just show the form. E-Mail would still be not sent. Reason is same, its all HTML and HTML just knows what to show on browser, to make it dynamic we use scripts. Again you need to embed a server side script.

You try out some web tutorials at w3schools.com. But befire continuing go through the very last chapter ( SUMMARY, WHAT NEXT etc...). It may clarify your doubts.

vishesh
Nearly a Posting Virtuoso
1,381 posts since Oct 2006
Reputation Points: 85
Solved Threads: 42
 

He says he wishes a way for a person to email him their own email adress. I beleive both above will serve the purpose, even a 'contact us' button. He does not elaborate on his intention for its use. I know that both above will do exactly that because i tried them, they open the users own email client and they can send.
a simple mailto as in #1 will suffice because he will still receive their adress for whatever purpose he intends. This is all he asks for.

Hi all im looking for a simple script that just has a single form where someone can enter their email address and the form will send that address to my email account , like "Subscribe to Newsletter" style thing...

Thanks all

notice he says "like" subscribe to newsletter, he does not ask specifically for a newsletter system.

Inny
Posting Whiz in Training
293 posts since Oct 2005
Reputation Points: 11
Solved Threads: 6
 

He doen't want any email client to do this job.
He wants something like in websites where we enter our email for subscription, and ofcource no email clent is opened. Try to email someone(member) using daniweb. You will see that no email clent is opened.

What he want is:
1. A textbox which will get the email from visiter i.e. you had made.
2. That email address to be directly mailed to his address. That where we had to do some server side.

What you are saying is not correct because:
1. Not all users use these email clients, including me.
2. Imagine yourself that you went to few website and they ask you for your email. You will enter email address and they will inturn open outlook. Frustating.
3. This approach will rely upon client's configuration(so you may not get what you want), and therefore is not secure, reliable.

vishesh
Nearly a Posting Virtuoso
1,381 posts since Oct 2006
Reputation Points: 85
Solved Threads: 42
 

He doen't want any email client to do this job.
He wants something like in websites where we enter our email for subscription, and ofcource no email clent is opened. Try to email someone(member) using daniweb. You will see that no email clent is opened.

What he want is:
1. A textbox which will get the email from visiter i.e. you had made.
2. That email address to be directly mailed to his address. That where we had to do some server side.

What you are saying is not correct because:
1. Not all users use these email clients, including me.
2. Imagine yourself that you went to few website and they ask you for your email. You will enter email address and they will inturn open outlook. Frustating.
3. This approach will rely upon client's configuration(so you may not get what you want), and therefore is not secure, reliable.

vishesh
Nearly a Posting Virtuoso
1,381 posts since Oct 2006
Reputation Points: 85
Solved Threads: 42
 

Ok I understand, Thankyou for explaining! :)

Inny
Posting Whiz in Training
293 posts since Oct 2005
Reputation Points: 11
Solved Threads: 6
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You