mailto link is blocked as insecure content in Chrome Gmail
Asked Answered
B

4

12

I've got a link in an encrypted HTML email that goes to mailto:blahblah, but it's being blocked in Chrome Gmail. Anything I can do about this?

Example:

1) I open an encrypted HTML email message inside of my encrypted GMail web client (https://gmail.com - notice the s in https).

2) The email contains a link in the folloiwng format: <a href="mailto:[email protected]">Email the user.</a>

3) I click on the link, but it is blocked because GMail and/or Chrome is treating the mailto link as insecure content.

4) I add target="_blank" to the aforementioned link and the problem goes away.

The rest of the message displays and functions correctly because, again, both the message and my email client are using encryption. The only thing that does not work is the mailto link.

Bonus question: how are mailto links classified with regard to protocols such as HTTP and HTTPS? Links to a W3C document would be helpful.

Belva answered 23/10, 2013 at 6:39 Comment(0)
S
10

From here: mailto link not working within a frame chrome (over https)

The suggestion is to use target="_top" instead of target="_blank".

Schopenhauerism answered 17/10, 2014 at 4:43 Comment(2)
i have tried top and blank and yet "connection is not secure", if i remove the mailto from the action goes fully secure so def is the form, any help? site is www.mr-programs.comKeefer
I found that I could use either value for target, but just needed the http, following this answer below https://mcmap.net/q/662377/-mailto-link-is-blocked-as-insecure-content-in-chrome-gmailClubhouse
B
3

I solved this with a little JavaScript trick.

Here is my index.html

<div>
    <input id="cname" required="" name="subject" type="text">
    <label for="cname">Name</label>
    <textarea id="cmessage" required="" name="body"></textarea>
    <label class="label-control" for="cmessage">Your message</label>
</div>
<button onclick="sendMail()">Click me</button>

and script.js which get loaded into index.html earlier.

function sendMail() {    
    var body = document.getElementById("cmessage").value;
    var subject = document.getElementById("cname").value;

    window.location.replace(`mailto:[email protected]?body=${body}&subject=${subject} wants to contact you`);    
}

and now I got the full green lock back.

enter image description here

Billings answered 17/2, 2021 at 15:22 Comment(0)
B
0

Add target="_blank" to the mailto link.

Belva answered 23/10, 2013 at 7:18 Comment(1)
The problem with this solution is an unnecessary blank tab is opened in Chrome before the parameters in the mailto link are passed off to the email client specified by the OS.Belva
D
0

I found simple solution for it just add https:// before your form action like:

<a href="mailto:[email protected]">Email the user.</a>

Change it to :

<a href="https://mailto:[email protected]">Email the user.</a>

I solved my issue by doing this I hope this work for you. If you get the solution please mark as solution. Thank you.

Dibri answered 12/6, 2019 at 5:9 Comment(3)
this isn't working for me. did you set up a redirect for your link? and how?Outworn
This worked for me and other solutions did not.Clubhouse
@Outworn Hey I believe its too late to answer. However, I have not added any redirection links.Dibri

© 2022 - 2024 — McMap. All rights reserved.