Learn to Code via Tutorials on Repl.it!

← Back to all posts
My Nodejs Module - mailCaptcha!


mailCaptcha is a Nodejs library that helps people by using a captcha! Just install, learn, and code!

how it works

So basically it uses Nodemailer and a random number generator to send a random 6 digit code to the user. No, it does not send your passwords and account data to me!, feel free to inspect the code!

Recent Updates - 1.0.3

  • Added Support For Custom Subjects
  • Added Support For HTML messages only!

Upcoming Updates

  • No upcoming updates, we could use some feedback in the issues section!


  • Me.

How to use!

Almost forgot! So here is the how to use it:


Require readline
Require readline to use as input, you can also use other methods of input besides prompt or alert, they will not work

Make the functions to see to deal with if the user entered the code in correctly
These functions will be executed wether the user entered the code correctly or not

Authorize ourselves with Google
Go enable less secure apps here for this to work

Ask the user their Email, and send the code
Use readline to ask the user for their email, to do this, use the verify.sendCode to send the code!

Ask the user to enter the code they recieved
Here, we use readline to see if the user entred the code in correctly, then it will execute one of the 2 functions.

Run the code and you are done!


verify.authentication(yourEmail, yourPassword)

Use this code to authenticate the account that will send the code! To do this you must also turn off less secure apps here.



Replace target with a valid email adress to send the code.


verify.verify(Code, correct, incorrect)

Ok, so the computer will look at the Code paramter and check if it matches the code sent. The correct parameter is actually a function. if the code matches the code sent, then this function will get executed. Same thing for the incorrect function except that will get executed if the code sent does not match the one the user put in.



Just replace the customCode parameter with a variable! Use it like this:



Now you can add custom messages! Here is how to use it:

When the message is sent, it will replace --CODE-- with the code! If you do not want a custom message, just dont call the message function! And we recently added HTML support! If you can, you can send an HTML file!

Like the one above, this works the same Except its for email subjects! Just replace the subject parameter with your email subject!

Known Bugs

  • No known bugs!

If you notice any bugs, report it to bugs! You can also send feedback in the issues section!

If you notice any bugs, report it to bugs! You can also send feedback in the issues section! (On Github)

So no more coding captchas! Turn to mailCaptcha today!

More info on npm for more updates and features!




@RayhanADev Thanks! Also the package dosen't work for some reason lol (It raises a few errors)


@Squirrel777 aww rip, I was gonna use it for my project xD.


@RayhanADev But just download it on the github! its the verify.js btw


@RayhanADev Also one more thing: I recommend using an alt account, just in case somebody somehow has gotten access to the .env file! (If your using one)


@Squirrel777 ahahhaha that’s why I have Hacker plan xD. I have at least 7-10 Repls you don’t see on my account because Hacker give private Repls lol.