-3

I see many sites with "Contact forms", with textboxes for name, surname, email, and a message. How are this information sent to the company? Is an email sent, or this information is stored in a database?

If an email is sent, could anyone tell me how to send emails with javascript without opening the email client on the user's pc?

Thanks a lot

Sean
  • 923
  • 3
  • 14
  • 36
  • javascript by itself can sent an email. you need to use server side technologies to do that – Dalorzo Jun 26 '14 at 21:34
  • possible duplicate of [Mail through Javascript](http://stackoverflow.com/questions/3690094/mail-through-javascript) – Maximillian Jun 26 '14 at 21:34
  • It's not that hard. http://www.w3schools.com/html/tryit.asp?filename=tryhtml_form_mail – Noble Mushtak Jun 26 '14 at 21:36
  • `mailto:` links like this don't work on Chrome, though. https://productforums.google.com/forum/#!topic/chrome/7l8_exIDFY8 – Noble Mushtak Jun 26 '14 at 21:38
  • 1
    @NobleMushtak That is *not* how standard 'contact forms' work; your example requires the user to have a local email client. OP is referring to a web app that sends the information from the web server itself. – admdrew Jun 26 '14 at 21:52
  • Well it's not very logic that my question is downvoted while the replies are upvoted. Are people who answer stupid questions smart? – Sean Jun 26 '14 at 22:11
  • @admdrew Oh...So a Python script in a server using the `email` package or something like that? – Noble Mushtak Jun 27 '14 at 13:03

3 Answers3

1

your only option is using a mailto in an href. This relies on the user sending the email themselves. You might be able to do something with javascript to populated the email .e.g

"mailto:"+emailTo+"&subject="+subjectText+"&body="+bodyText

try to see this Need to Send Email from HTML pages

Community
  • 1
  • 1
MickyScion
  • 526
  • 2
  • 14
1

Generally these forms will POST the information to a server at a particular url. The maintainer will set up their server so that this url runs a script. That script may send an email and/or add the information to a database.

You could set up the server yourself, or use someone else's server that will do this for you.

Nick Retallack
  • 18,986
  • 17
  • 92
  • 114
1

Another solution: Google Contact Forms

stroz
  • 1,890
  • 1
  • 16
  • 28