# Send-mailmessage with clickable link

**URL:** <https://forums.powershell.org/t/send-mailmessage-with-clickable-link/19080>\
**Category:** PowerShell Help\
**Created:** [April 13, 2022, 6:21pm UTC](https://forums.powershell.org/t/send-mailmessage-with-clickable-link/19080 "2022-04-13T18:21:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomlon](https://avatars.discourse-cdn.com/v4/letter/t/d6d6ee/32.png) [@tomlon](https://forums.powershell.org/u/tomlon)\
**Post date:** [April 13, 2022, 6:21pm UTC](https://forums.powershell.org/t/send-mailmessage-with-clickable-link/19080/1 "2022-04-13T18:21:37Z")

</div>

I am using the Send-MailMessage (I know it is obsolete). I am wanting to include a hyperlink in the body. The hyperlink is derived from a variable. For instance $link. I can set the body = $Link and it will place the text in the email. But I want a link. So I have set following:

```auto
-body '<a href=$Link>Link</a>' `
-BodyAsHTML

```

It will generate the email with the hyperlink, but the link is $Link (not the var value. I have tried with $Link and “$Link” I can put a static path in and it works, but it changes. I need it to be derived from $Link.

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [April 13, 2022, 6:48pm UTC](https://forums.powershell.org/t/send-mailmessage-with-clickable-link/19080/2 "2022-04-13T18:48:46Z")

</div>

If you need your variables inside strings substituted with their actual values you have to wrap the string in double quotes instead of single quotes.

> **[Everything you wanted to know about variable substitution in strings -...](https://docs.microsoft.com/en-us/powershell/scripting/learn/deep-dives/everything-about-string-substitutions?view=powershell-7.2)**
>
> There are many ways to use variables in strings to create formatted text.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:18pm UTC](https://forums.powershell.org/t/send-mailmessage-with-clickable-link/19080/3 "2024-05-16T20:18:05Z")

</div>


