mailto-link-generator

1.0.3 • Public • Published

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: 'recipient@example.com', cc: ['cc1@example.com', 'cc2@example.com'], bcc: 'bcc@example.com', 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: 'recipient@example.com',
  cc: ['cc1@example.com', 'cc2@example.com'],
  bcc: 'bcc@example.com',
  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:

  1. 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:example@example.com">) makes it easy for bots to identify and extract email addresses.
  2. 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.
  3. 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.
  4. 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.

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:

  1. Validation: Ensures accurate and secure data.
  2. Security: Guards against vulnerabilities like XSS and CSRF.
  3. Storage: Organizes and manages form data effectively.
  4. Email Deliverability: Improves reliability compared to user's email client.
  5. Integration: Connects with various tools and services.
  6. Customization: Offers more control over workflows and notifications.
  7. Scalability: Handles large volumes of form submissions.
  8. User Experience: Provides better control over design and functionality.

Package Sidebar

Install

npm i mailto-link-generator

Homepage

veilmail.io

Weekly Downloads

2

Version

1.0.3

License

MIT

Unpacked Size

5.31 kB

Total Files

3

Last publish

Collaborators

  • irishgeoffrey