No-code4 min read
Add a “Share by email” link in Webflow

Introduction
| Mailto parameter | Description | Example |
|---|---|---|
| to | Recipient (leave blank to let them choose) | |
| subject | Email subject | Check out this article |
| body | Email body (URL-encoded) | https://your-site.com/article |
In this tutorial, Sandro, co-founder of the Gemeos Webflow agency, shows you how to add a "Share by email" link in Webflow.
Adding a "Share by email" button to a website comes with a few perks:
- Makes sharing easy: The "Share by email" button lets users quickly share site content with friends, family, or coworkers through their inbox. That can be handy for spreading important or interesting information.
- Expands your reach: Email is still a widely used way to communicate, even in the age of social media. By adding this sharing option, you let your content reach a broader audience that may not be active on social platforms.
Here’s how to do it!
1. Add a trigger element to your page
You can use any element you want, such as a Div or Link.

2. Add the id "mail" to it

3. Add this custom code
You can add it before the <body> on your page, or drop it straight into an embed inside your element.
<script>
// Function to open a new email with the current page link
function openNewEmail() {
// Get the current page URL
var url = window.location.href;`
`// Encode the URL for the email body
var encodedUrl = encodeURIComponent(url);`
`// Create the mailto link with the body text
var mailtoLink = "mailto:?body=" + encodedUrl;`
`// Open a new tab with the mailto link
window.open(mailtoLink);
}`
`// Add a click event listener to the div with the id "mail"
var mailDiv = document.getElementById("mail");
mailDiv.addEventListener("click", openNewEmail);
</script>4. Publish and test the result




