Search code examples
reporting-servicesssrs-2012mailto

SSRS Mailto expression/hyperlink inside a textbox


Im looking for a way to create a mailto link inside of a textbox. Example...

Click me to email this list of people.

With the "Click me" being the hyperlink. I already have a query that returns all the email address and a parameter that stores said email address. But when i try to pass them to the the mailto expression

="Mailto:" & Join(Parameters!EmailAddresses.Value, "; ")

the words/textbox becomes unclickable? I have also confirmed that the parameter has the email in them by dumping them to the screen. I would also prefer to bcc everyone the query returns.

Thanks!


Solution

  • To troubleshoot your issue, right click your link and "Inspect Element" when viewing the report from a browser. The space in "; " is part of the issue. Note that the code is being interpreted by the browser. So spaces and other special characters can affect how they are handled. Many others have noted issues attempting to email multiple addresses.

    My recommendation would be to use JavaScript to get around any issues. See below examples:

    Mailto Using JavaScript:

    ="javascript:(window.location('mailto:" &Join(Parameters!EmailAddresses.Value, ";")&"'))"
    

    BCC option:

    ="javascript:(window.location('mailto:?BCC=" &Join(Parameters!EmailAddresses.Value, ";")&"'))"