Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ General Web Design _ HTML 5 - Trying to make a clickable link that sends an email

Posted by: bigmowebsites Sep 3 2020, 03:21 PM

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.

Posted by: Christian J Sep 3 2020, 06:44 PM

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.

Posted by: pandy Sep 3 2020, 07: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 .

Posted by: bigmowebsites Sep 6 2020, 12:41 PM

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.

Posted by: pandy Sep 6 2020, 12: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.

Posted by: bigmowebsites Sep 6 2020, 01:06 PM

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!

Posted by: pandy Sep 6 2020, 01: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

Posted by: bigmowebsites Sep 8 2020, 05:06 PM

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!

Posted by: pandy Sep 8 2020, 06:25 PM

It's a wide, wide web! laugh.gif

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)