undefined
undefined

Reputation: 5330

Why do mailTo links open gmail in the same window despite setting target=_blank?

I am trying to allow users of our website to click on a link and open a mail application / gmail to compose a message. I am using the mailTo method which opens my mail application on mac, however when I set gmail as my default mail application in browsers settings (eg chrome and firefox) it will open gmail in the same window as the page on which the link was clicked.

I know that target=_blank is not really intended for mailTo links but I tried it and even this does not open the link in a blank window.

Surely this isnt a bug in these browsers, there must be a way to do this.

Upvotes: 3

Views: 1895

Answers (1)

Steven
Steven

Reputation: 1365

Mailto does not open a window or tab in any instance. If you want to use a window or tab you need to configure a form and allow the form to open in your window/tab. Of course, you'll have to configure the form to send mail with whatever method is available on your server.

source

Upvotes: 1

Related Questions