Learn to Code via Tutorials on Repl.it!

← Back to all posts
My Nodejs Module - mailCaptcha!
Squirrel777

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!

Credits

  • Me.

How to use!

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

Install/require

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!

Functions

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.

================================================================

verify.sendCode(target)

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.

================================================================

verify.createCode(customCode)

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

================================================================

verify.message(message)

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!

================================================================
verify.subject(subject)
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!

Voters
Viper777
RayhanADev
programmeruser
Squirrel777
Comments
hotnewtop
RayhanADev

Noice!

Squirrel777

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

RayhanADev

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

Squirrel777

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

RayhanADev
Squirrel777

@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)

RayhanADev

@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.

Squirrel777