Help - Search - Members - Calendar
Full Version: HTML 5 - Trying to make a clickable link that sends an email
HTMLHelp Forums > Web Authoring > General Web Design
bigmowebsites
Hello community-

I am currently designing a website for my friend - we want to have a section where the user can type in a form, click a button, and the site will redirect them to their email client with form as the body of the email. (sorry if that's confusing to get across)
To open an email, I thought you could simply type <a href="mailto:webmaster@example.com"> and then end it with a </a>. This doesn't seem to be working anymore... not sure why? I can upload a picture of my HTML code if needed.

Thanks in advance.
Christian J
First of all it requires the user to have an email program installed on his computer. Today many are only using GMail or similar webmail services.
pandy
Usually the browser also needs to be configured to open said email client. At least that's how it used to be. Exception MS products that try to open OE.

But a link (<a href="mailto:...">...</a> can't be used with a form. You need to use the mailto as the value of the action attribute in the form tag.

See https://htmlhelp.com/reference/html40/forms/form.html and https://htmlhelp.com/faq/html/forms.html#mailto-form .
bigmowebsites
QUOTE(pandy @ Sep 3 2020, 08:08 PM) *

Usually the browser also needs to be configured to open said email client. At least that's how it used to be. Exception MS products that try to open OE.

But a link (<a href="mailto:...">...</a> can't be used with a form. You need to use the mailto as the value of the action attribute in the form tag.

See https://htmlhelp.com/reference/html40/forms/form.html and https://htmlhelp.com/faq/html/forms.html#mailto-form .


Gotcha. Thank you for the links, I will go over them and hopefully i'll be able to get it to work.
It seems that having a link open to a web browser isn't working, which is confusing me... I've used this many times in the past, but now it seems to be broken.
Here is an example of what i'm talking about -
<a href="mailto:exampleemail@gmail.com">Click here to email us!</a>
Is there any reason this shouldn't work?

Thank you in advance.
pandy
That should work. I thought you tried to used the link with the form.

As said, you may need to configure your browser to open the email client of your choice. To be honest I'm not up today how this works nowadays with the dumbed down browsers we have.
bigmowebsites
QUOTE(pandy @ Sep 6 2020, 01:45 PM) *

That should work. I thought you tried to used the link with the form.

As said, you may need to configure your browser to open the email client of your choice. To be honest I'm not up today how this works nowadays with the dumbed down browsers we have.

You were 1000% right, the issue was my PC. I've been using that line of code to get to an email for a very long time so I was super confused why it wasn't working.

Thank you for your help so far, I will try to get the form going soon. Happy labor day!
pandy
Ah, good. Happy labor day to you too! I don't really celebrate that (I'm in Scandinavia), but I can make an exception for you. laugh.gif
bigmowebsites
QUOTE(pandy @ Sep 6 2020, 02:14 PM) *

Ah, good. Happy labor day to you too! I don't really celebrate that (I'm in Scandinavia), but I can make an exception for you. laugh.gif

Oh lol sorry!
pandy
It's a wide, wide web! laugh.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2020 Invision Power Services, Inc.