0

I'm trying to create a link that pops open a new email in outlook:

<a href="mailto:someaddress@mail.com?subject=blah">Feedback</a>

and this works fine in firefox, but in IE9 it's literally redirecting the browser to "mailto:someaddress@mail.com?subject=blah". The email window still pops up but I need IE to remain on the same page where the mailto link was clicked.

EDIT: I have now pinpointed this to being a SharePoint 2007 problem. The mailto href works fine before adding a Search Core Results webpart to the page, but after adding the Core Results webpart, the previously described problem takes place.

1

I still dont know what the exact cause of the problem is but I was able to get around it by doing the following:

Add a hidden iframe to the page:

<iframe id="emailiframe" src="" style="display:none;"></iframe>

In the content editor web part that contains my "feedback" link, I set the source to:

<script type="text/javascript">
function feedbackEmail()
{
var iframe = document.getElementById("emailiframe");
iframe.setAttribute("src", "mailto:someaddress@mail.com?subject=blah");
}
</script>

<a href="javascript:void(0);" onclick="feedbackEmail(); return false;">Feedback</a>

IE now does what it's supposed to.

0

Have you tried this?

<a href="mailto:someaddress@mail.com?subject=blah" target="_self">Feedback</a>
  • I've tried every target attribute value and still get the same behavior. – MattL922 Aug 15 '12 at 11:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.