Avatar of CoStar
CoStar
Flag for New Zealand asked on

How do I submit my HTML form by e-mail?

I created a simple form on a webpage, where I ask for visitors to enter their e-mail address and click 'Submit' if they want to be notified of an event.
When I test the form, nothing happens, apart from the re-direct to a second webpage.

This is the code I use:

<form action="info@invoiceit.com" method=post enctype="text/plain">
<input type="hidden" name=tx1>
<input type="text" name="tx2" size="27" value="enter your e-mail address"><a href="thanksforwantingcloud.htm">
<input type=submit value="Send it" name="B1"><input type="reset" value="Reset" name="B2">
</form>

What is missing to send the content of that text box to my e-mail address?

Hope you can help - thank you.
HTML

Avatar of undefined
Last Comment
Dave Baldwin

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Dave Baldwin

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
CoStar

ASKER
Thank you so much. I modified the code along your example and it now reads
<form action="info@invoiceit.com" method="get">
<input name="subject" type="hidden" value="Notify Cloud release">
<textarea name=body cols="40" rows="1">e-mail address</textarea>
<a href="thanksforwantingcloud.htm">
<input type=submit value="Send it" name="B1">
<input type="reset" value="Reset" name="B2">
</form>

Open in new window


Unfortunately, no mail arrives.
I can't see where I go wrong. It seems so simple, yet so elusive.
Dave Baldwin

You removed the 'mailto' part.  It will not work without that.  And this <a href="thanksforwantingcloud.htm"> does absolutely nothing.  Remove it.
CoStar

ASKER
yes, I omitted that and now it works. Thank you for pointing it out.
Just one little thing left:
I use value="Notify Cloud release" as the subject, but on the e-mail it appears as
Notify+Cloud+release
Do you know how the + signs can be changed to spaces?
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Dave Baldwin

They can't as far as I know.  They are required because of the way the email program is called from the web browser.
CoStar

ASKER
I figured it out:
value=Notify&nbsp;cloud&nbsp;release
Thank you for all your help. Points are awarded
Dave Baldwin

Thanks, glad to help.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.