"Mailto" link opens empty new tab

Hi, I’m trying to use “mailto” and it’s opening both the email client AND an empty new tab, which I don’t want. I’ve tried both the built-in email option and manually typing “mailto:” into the basic URL option. When doing that, I had “Open in new tab” unchecked. It didn’t work.

I’ve seen two threads on this but they’re both closed. Anyone know what’s up?


Here is my site Read-Only:

https://preview.webflow.com/preview/random-157d6a-5476ed86c5c-65d335441fd7b?preview=dbd41e027d1d3149f5146facad37281b

I don’t like bumping things but I posted this three days ago and newer threads have been acknowledged. Is there no fix for this? If so, I can accept that but it would be good to have confirmation so I can figure out what to do instead. Thanks!

Hi Hairspray,

Which element is this on, the fixed social block on the bottom right corner?

If you can’t get the email tab to work, you can do this:

image

Yes, it’s there - the “MAIL” button (and on mobile it moves to the top right).

I was doing this initially, and with the “Open in new tab” left unchecked, but it still opened that new tab. So I switched to the proper email tab in the hope that would fix it but alas.

Yes, as @orgreeno says, then add - target=“_self” to make open in the same window. If you want a new window add - _blank.

I’m one of those Webflow users who really doesn’t know code, so it looks like I’m doing something wrong. I’ve attempted to take your advice in these two ways but I don’t really know what I’m doing. What am I doing wrong?

46%20am

54%20am

Thanks for your patience and help with this so far, guys.

No you did it right from what I can see here. The email reference will open the user default email client on their machine. You shouldn’t have to do anything else once you add the email.

Can you set it up in your site and save it, then let me go in a test it.

WAIT! You need to have this in the Mail button section, the 4th button

Hey, I’ve set it up in the Mail section and saved it. It’s still opening the blank tab.

I’m so sorry for this inconvenience. This is such a ridiculous and annoying problem. :frowning:

But the fact that your code isn’t working AND the Webflow in-built default action of opening links within the same tab are both not working makes me wonder if there’s something that’s overriding them both. Because how can BOTH things not work? It’s weird.

EDIT: Just remembered, I also made a completely new project and added only one div with basic text. When I made this an email link, it also automatically opened a new blank tab despite me not selecting that. Maybe my Webflow account itself is the problem?

1 Like

Hey there, this is what I get when I click the “EMAIL” link in the bottom right corner:

This is exactly what should happen. It will open the users default email program. Can you take a screenshot of what you see on your machine when clicking the link?

Mine is the same. But that Untitled tab in your screenshot is exactly what I’m trying to avoid because it’s not needed. So your code was working all along, and so was the Webflow option! I’m so sorry for having wasted your time.

After doing more research, I realise this is normal link behaviour and to get rid of that tab like I want to requires Javascript.

Here’s what I was after:
Plunker - Mailto and how to trigger it (See the behaviour of the “Contact Us” link).

I’m going to try using this. Now that I understand everything is actually in working order, I can proceed with confidence. Thanks again, Gary!

Ah I gotcha, yeah that immediate popup would need JS, I’m sorry for misunderstanding. Excellent! Glad you found the right direction. Have Fun!

1 Like

Gary, it worked!!! Thank you again for helping me get here!

For anyone else who wants just an email pop-up with no new tabs, here is the code I used:

    <script data-require="jquery@*" data-semver="2.0.3" src="//code.jquery.com/jquery-2.0.3.min.js"></script>

<script>
  function addMailIframe() {
    $('<iframe src="mailto:youremail@youremaildotcom>')
       .appendTo('#myIframe')
       .css("display", "none");
  }

</script>
1 Like

This topic was automatically closed 125 days after the last reply. New replies are no longer allowed.