views:

352

answers:

3

I am using an anchor with mailto, and I am finding that the behavior is extremely unrefined.

<a id="Help" href="mailto:[email protected]">Questions</a>

when I do this in IE8, I find that in some locations, the windows asks if it can open outlook, you say yes, and it opens a new email message and sets the To: section. It also leaves the browser window in the same site that I came from.

When I do this in my implementation with the above link, I find that the browser navigates to mailto:[email protected], and shows an ugly: Internet Explorer cannot display the webpage error. What do I need to do to make this work nicely, like the above case? Finally, it fails to leave the browser in the original location that I came from.

Edit: I just noticed that the badly behaving version is local host and the good behaving version is on a production server. Could that make a difference?

A: 

This is completely in your browser.

Go into Folder Options (Control Panel), File Types, and see what handler is associated with the URL:Mailto protocol. You'll have to click on Advanced and edit the 'open' action to see what is the handler/server for that filetype association.

chamiltongt
+1  A: 

I notice you've tagged this with jQuery. Is it possible that there is an event handler being added to the link which does something like this:

$('a').click(function() {
    window.location.href = this.href;
    return false;
});
nickf
interesting, I will look for that
MedicineMan
+1 nice thinking
Mendy
do you have any other suggestions?
MedicineMan
nope, didn't work. It seems to work intermittently, and perhaps a little more frequently. Perhaps I should change the question to be: "Why does IE suck?"
MedicineMan
A: 

Part of the problem appears to be that IE has problems with long mailto links.

http://stackoverflow.com/questions/2241274/mailto-fails-in-ie-with-long-body-any-resolution

Keep your links less than 512 characters, and you should see fewer problems when using IE.

MedicineMan