Jump to content

okay so i know that with anchor tag i can create a link to redirect people to another webpage from my page but can you guys help me with making a hyperlink so that it will automatically open the gmail.com and go to the create email section and put my email address in the to: box like i have seen this feature in some of the sites so is that possible to make without javascript?

 

Link to comment
https://linustechtips.com/topic/1409519-hyperlinks-in-html/
Share on other sites

Link to post
Share on other sites

Not everyone uses Gmail ... don't make such assumptions.  People use lots of other online email services or use email programs (Outlook, Mozilla Thunderbird, The Bat etc) to retrieve and compose/send email).

The best you can do is to use the mailto command  ... 

<a href="mailto:your_email@gmail.com"> Send me an email </a>

You can also set up the subject and other fields like CC for example (but up to the mail application if they accept and set those fields) .. see https://css-tricks.com/snippets/html/mailto-links/

 

When someone clicks on  the link, the web browser looks in the operating system to find what application is associated with the mail and launches that application and passes the information to the application, and the application will show the Compose window where user could type an email.

Unless there's some extension/add-on in the browser or some application that intercepts that mailto and opens gmail in a browser window, there's no way for the operating system to guess that user has gmail.  Windows being Windows may open up hotmail or some microsoft mail site if there's mail client associated, I have no idea.

 

 

Link to comment
https://linustechtips.com/topic/1409519-hyperlinks-in-html/#findComment-15245351
Share on other sites

Link to post
Share on other sites

4 hours ago, mariushm said:

The best you can do is to use the mailto command  ...

A small word of warning: Bots are going to find and harvest such an email address. So be prepared to receive a lot of spam.

https://www.civicwebmedia.com.au/how-to-reduce-spam-emails-from-your-website/

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
https://linustechtips.com/topic/1409519-hyperlinks-in-html/#findComment-15245698
Share on other sites

Link to post
Share on other sites

On 2/5/2022 at 5:48 PM, mariushm said:

Not everyone uses Gmail ... don't make such assumptions.  People use lots of other online email services or use email programs (Outlook, Mozilla Thunderbird, The Bat etc) to retrieve and compose/send email).

The best you can do is to use the mailto command  ... 

<a href="mailto:your_email@gmail.com"> Send me an email </a>

You can also set up the subject and other fields like CC for example (but up to the mail application if they accept and set those fields) .. see https://css-tricks.com/snippets/html/mailto-links/

 

When someone clicks on  the link, the web browser looks in the operating system to find what application is associated with the mail and launches that application and passes the information to the application, and the application will show the Compose window where user could type an email.

Unless there's some extension/add-on in the browser or some application that intercepts that mailto and opens gmail in a browser window, there's no way for the operating system to guess that user has gmail.  Windows being Windows may open up hotmail or some microsoft mail site if there's mail client associated, I have no idea.

 

 

Thanks helps a lot

Link to comment
https://linustechtips.com/topic/1409519-hyperlinks-in-html/#findComment-15248110
Share on other sites

Link to post
Share on other sites

  • 3 months later...

I know it has been a long time since the last post, but what you could do to reduce the number of spam emails from bots, is to implement a hidden text field as a rudimentary honey pot.

Further more instead of using an anchor tag with the mailto: prefix, you could implement a button with an onClick event that checks to see if the hidden form field has data entered; if there is data, do nothing. Else trigger the mailto: within js.

Link to comment
https://linustechtips.com/topic/1409519-hyperlinks-in-html/#findComment-15391434
Share on other sites

Link to post
Share on other sites

2 minutes ago, El Capitan Sponge said:

I know it has been a long time since the last post, but what you could do to reduce the number of spam emails from bots, is to implement a hidden text field as a rudimentary honey pot.

Further more instead of using an anchor tag with the mailto: prefix, you could implement a button with an onClick event that check to see if the hidden form field has data entered; if there is data, do nothing. Else trigger the mailto: within js.

This is very good for stopping bots

Link to comment
https://linustechtips.com/topic/1409519-hyperlinks-in-html/#findComment-15391439
Share on other sites

Link to post
Share on other sites

Just now, El Capitan Sponge said:

Indeed, although I have encountered many hilarious, and sometimes annoying spam emails over the years

yes capcha is always the best solution and a having good robots.txt file on webserver  always helps

Link to comment
https://linustechtips.com/topic/1409519-hyperlinks-in-html/#findComment-15391446
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×