1 Reply Latest reply on Jun 15, 2012 7:29 AM by kvanderwende

    Problem with mailto

    kvanderwende

      I have an issue with Safari 5.1.7 and mailto links.  Our QA has reported that it also happens in IE9.  If i have a label with htmlText that creates a mailto link, my main application will disappear.  I have tried several variations in a test app and our main app.

       

      htmlText = "<a href='mailto:mail@domain.com'>Contact me</a>"; causes the app to disappear.

       

      Adding an event listener and using navigateToUrl with mailto:mail@domain.com and window "_self" also causes the app to disappear.

       

      Is there a workaround for this behavior?  I've tried using JavaScript to open the mailto to no avail.

       

      Thanks,

      Kevin

        • 1. Re: Problem with mailto
          kvanderwende Level 1

          I am not thrilled with this solution but it is working in my test app without causing the swf to hide everything when the link is clicked.  I have a JavaScript function as follows:

           

          function launchMail(mailtoLink)

          {

              window.open(mailtoLink, "_self");

          }

           

          From my event listener in Flex I do this (linkEmail is my mailto:):

          if (ExternalInterface.available)

          {

              ExternalInterface.call("launchMail", linkEmail);

          }

           

          Note that when I tried setting htmlText to a link that calls the JavaScript function I got the same behavior as my original post.  This appears to only work when using ExternalInterface from an event handler.

           

          This resolves my immediate problem.  Our code has mailto links in quite a number of places.  We will probably eventually use our own e-mail form but this works for now.