Search code examples
javascriptjqueryhtmlmailto

Javascript - Check if email configured


We can send a mail using mailto: in HTML and JavaScript. Is there any possible method to check if the email is configured (i.e. whether any default email service to send email - such as Outlook - is available)?

I need to handle this

if(emailConfigured == true)

{
    // send mail

} else {

    // give alert
}

Solution

  • No, you can't do this. It is completely impossible. The JavaScript environment has no access to the host computer to tell if something is configured to handle mailto: links. That is so far outside the bounds of your webapp's responsibility that you should not and can not worry about it. It's not your page's job to figure out if the user knows how to send emails.