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

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>

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

Member Avatar for GreenDay2001

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

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>
Member Avatar for GreenDay2001

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.

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.

Member Avatar for GreenDay2001

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.

Member Avatar for GreenDay2001

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.

Ok I understand, Thankyou for explaining! :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.