Justin Justin - 2 years ago 119
Javascript Question

Invoke / click a mailto link with JQuery / JavaScript

I'd like to invoke a mailto link from JavaScript - that is I'd like a method that allows me to open the email client on the users PC, exactly as if they had clicked on a normal mailto link.

How can I do this?

Answer Source

You can use window.location.href here, like this:

window.location.href = "mailto:address@dmail.com";
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download