mailto-link-generator
v1.0.3
Published
Generate a mailto protocol link
Downloads
14
Maintainers
Readme
mailto-link-generator
A simple utility to generate mailto
links for sending emails using Node.js.
Installation
npm install mailto-link-generator
#Usage
const mailtoLink = require('mailto-link-generator');
const options = { to: '[email protected]', cc: ['[email protected]', '[email protected]'], bcc: '[email protected]', subject: 'Hello World', body: 'This is the body of the email.', };
const link = mailtoLink(options); console.log(link);
# mailto-link-generator
A simple utility to generate `mailto` links for sending emails using Node.js.
## Installation
```bash
npm install mailto-link-generator
Usage
javascript
Copy code
const mailtoLink = require('mailto-link-generator');
// Example usage
const options = {
to: '[email protected]',
cc: ['[email protected]', '[email protected]'],
bcc: '[email protected]',
subject: 'Hello World',
body: 'This is the body of the email.',
};
const link = mailtoLink(options);
console.log(link);
API
mailtoLink(options) Generates a mailto link based on the provided options.
Parameters options (Object): An object containing email options. to (String or Array of Strings): Recipient email addresses. cc (String or Array of Strings): Carbon copy email addresses. bcc (String or Array of Strings): Blind carbon copy email addresses. subject (String): Email subject. body (String): Email body.
Using a mailto
link in HTML can expose email addresses to email harvesters and increase the likelihood of receiving spam. Here's why:
Easy Extraction:
mailto
links are easily readable by web crawlers and email harvesting bots. These automated programs scan websites for email addresses and add them to spam lists.- The straightforward structure of
mailto
links (e.g.,<a href="mailto:[email protected]">
) makes it easy for bots to identify and extract email addresses.
No Obfuscation:
- Unlike some JavaScript-based techniques or server-side solutions that can obfuscate email addresses,
mailto
links are plain text in the HTML source code. They don't provide any inherent protection against automated harvesting.
- Unlike some JavaScript-based techniques or server-side solutions that can obfuscate email addresses,
Direct Connection:
mailto
links open the default email client when clicked. This direct connection between the webpage and the email client makes it easy for spammers to identify and target active email addresses.
Widespread Usage:
- As
mailto
links are commonly used for legitimate purposes, email harvesters specifically target websites and pages where these links are prevalent. Including such links in your HTML code increases the likelihood of being harvested.
- As
To minimize the risk of email harvesting and spam, consider using the VeilMail.io Mailto Link Generator . It's free. VeilMail hides your email address behind a non-intrusive form captcha that makes sure you are human and not a bot.
See it in use.
You can get reach me at https://veilmail.io/e/HyBkVK
Form Backend Service
Using a form backend service is preferable to a mailto
link for these reasons:
- Validation: Ensures accurate and secure data.
- Security: Guards against vulnerabilities like XSS and CSRF.
- Storage: Organizes and manages form data effectively.
- Email Deliverability: Improves reliability compared to user's email client.
- Integration: Connects with various tools and services.
- Customization: Offers more control over workflows and notifications.
- Scalability: Handles large volumes of form submissions.
- User Experience: Provides better control over design and functionality.