Using anchor tag to open a mailto and invoke a URL

vaibhav picture vaibhav · Dec 4, 2013 · Viewed 30.9k times · Source

With one of my requirements i need to open up the default mailing client with invoking a call to a service, this needs to be accomplished using anchor tags or purely html, the constraint is that we can not use javascript for the same. Does anyone have any idea on how to accomplish this?

Answer

Yagnesh Agola picture Yagnesh Agola · Dec 4, 2013

try this:

<a href="mailto:[email protected]">Click to Mail</a>  

This will open default mailing client.

Edit :
You may use onClick function to open new window and call you webservice url in it.like

<a href="mailto:[email protected]" target="_blank" onclick="window.open('your WS URL');">Click to Mail</a>