An open-source, self-hosted API solution for email verification.
Verifly creates an API endpoint, which can be used to request a random verification code and send it to the specified email afterwards.
Logo by Hadi Sadik
-
Clone the repository
cd desired/target/directory git clone https://github.com/Randware/Verifly -
Install the dependencies
npm install
-
Modify the auth.env configuration file
Update the authentication credentials to enable sending emails.
See the documentation of the Environment Variables -
Run the api in the directory with the repository
npm run
All of these variables are for the nodemailer dependencies. Â For detailed descriptions of all variables, head to:Â https://nodemailer.com/smtp/
| Parameter | Type   | Description         |
|---|---|---|
apiPort |
integer |
 the port on which the API runs |
host |
string |
 the smtp host (smtp.example.com) |
port |
integer |
the host port to connect to |
service |
string |
the service of your email. Leave blank if you have a host address |
secure |
boolean |
enable or disable the use of SSL (leave blank if you don't know what you do) |
secureConnection |
boolean |
enforce the use of TSL |
rejectUnauthorized |
boolean |
 allows TLS server with self-signed or invalid TLS certificate |
display_name |
string |
 the display name of the sender |
user |
string |
the email (username) of the sender |
password |
string |
the password of the given email |
Here is an auth.env example for Outlook:
apiPort=3030
host="smtp-mail.outlook.com"
port=587
service=""
secure=
secureConnection=false
rejectUnauthorized=false
display_name="Verifly"
user="example@outlook.com"
password="password"
An example for Mailtrap Â
apiPort=3030
host="sandbox.smtp.mailtrap.io"
port=2525
service=""
secure=
secureConnection=false
rejectUnauthorized=false
display_name="Verifly"
user="0d4f******"
password="c0629*****"An example for MailerSend
apiPort=3030
host="smtp.mailersend.net"
port=587
service=""
secure=
secureConnection=false
rejectUnauthorized=false
display_name="Verifly"
user="ex_ample@trial-XXX.mlsender.net"
password="gGHqZR9t*******"
 POST /verify| Parameter | Type   | Description         |
|---|---|---|
email |
string |
Required The recipient's email |
subject |
string |
subject of the email |
html |
string |
your html styled text content (use if possible) |
text |
string |
plain text content of the email |
from |
string |
 "display_name < your@mail.com >" (not recommended) |
cc |
string |
 the cc for the mail |
bcc |
string |
the cc for the mail |
verification_code_length |
integer |
the lengh of the verification code |
verification_code |
string |
your own custom verification code, if desired |
verification_code_special_chars |
boolean |
include special characters in verification code |
| Placeholder       | Description                                 |
|---|---|
| ${verification_code} | the placeholder for the verification code |
| ${emailTo} | the recipient email |
| ${emailFrom} | the sender email |
| ${display_name} | the sender display name |
const requestBody = {
  email: "example@mail.com",
  verification_code_length: 10,
  html: "<p>Here is your verification code: ${verification_code}<p>"
}
fetch("http://urlToApi.com/verify", {
  method: "POST",
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify(requestBody)
}) Â .then(res => res.json()) /
  .then(data => console.log(data))
  .catch(err => console.log(err));A: If you get this error when trying to run git clone, it is likely because git is not installed. Â
To install git, follow this guide:
https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
A: If you get this error when trying to run npm install, it is likely because npm is not installed. Â
To install npm, follow this guide: Â
https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
A: If you have another issue related to Verifly, feel free to open an issue on: Â https://github.com/Randware/Verifly/issues
.png)