Is there any free testing send OTP by any way like whatsapp, Email or sms or any other free way?

Is there any free testing send OTP by any way like whatsapp, Email or sms or any other free way?

Did you search ?

Did you try my Firebase OTP again after the proposed fix I provided ?

I also put together an email OTP example HERE

yes i tried the firebase sms otp but didnt receive the message as i senr there, i think that email otp is a good way but am a little confused about adding scripts and the web url as they didnt show everything there

  • Are you testing on your mobile device? (Android version ?)

  • You correctly added the webviewextra extension ?

  • Is phone selected and enabled correctly in the authentication section

  • Have you checked your SMS regions in the firebase console? Ensure Deny is selected with nothing checked.

  • what firebase plan are you using. You probably need to upgrade to Blaze (you get pretty good free quotas)

Yes, it is not straightforward :wink:

Andriod 13 but nevermind about the sms, lets help me in that email verification i wanna try that aia sample file
first i will create a new sheet and what next will i create a form or no need?
second will i adjust anything in these script codes like adding my sheet id or script link and will add i both doget in a script page and html in another script page withoud adjusting anything?
third will i add my sheet link to the web link URL in the main behavior or the script code will without adding and will i add that in the end on the app script url ?HTMLOTP=?

Follow the guide, it tells you what to do.

If unsure about Apps Script:

To do email otp, use apps script method but oer day 100 otp only can be sent. So once request taken by the user disable request on the same day for another new request. This code will send the otp to the user email also saves in the sheet.

Ao you can verify the otp too using post method

Take otp by doget

Verify otp by dopost

function doGet(e) {
  var email = e.parameter.email;
  var otp = Math.floor(100000 + Math.random() * 900000).toString(); // Generate a 6-digit OTP

  // Open the Google Sheet to store OTPs
  var sheet = SpreadsheetApp.openById('YOUR_SHEET_ID').getSheetByName('Sheet1');
  
  // Save the OTP in the sheet along with the email
  sheet.appendRow([email, otp, new Date()]);

  var subject = "Your OTP Code";
  var body = "Your OTP code is: " + otp;

  // Send email
  MailApp.sendEmail(email, subject, body);

  // Return a response
  return ContentService.createTextOutput("OTP sent to " + email);
}


function verifyOtp(email, otp) {
  // Open the Google Sheet to verify OTPs
  var sheet = SpreadsheetApp.openById('YOUR_SHEET_ID').getSheetByName('Sheet1');
  var data = sheet.getDataRange().getValues();

  for (var i = 0; i < data.length; i++) {
    if (data[i][0] == email && data[i][1] == otp) {
      // OTP verified, you may consider removing the OTP for security
      sheet.deleteRow(i + 1); // Remove the row after verification
      return "OTP verified!";
    }
  }
  return "Invalid OTP!";
}

function doPost(e) {
  var email = e.parameter.email;
  var otp = e.parameter.otp;

  // Call the verify function
  var result = verifyOtp(email, otp);
  
  return ContentService.createTextOutput(result);
}

Add your sheet id and deploy it. Deploy with anyone to access it.

This cide deletes the otp once it is validated

thanks so much, This is the easiest way i found with do some adjustments so here is the sample file for helping anyone here with the code after removing ```
"OTP sent to " + email
here is the sample aia file i created just add your sheet id in the script code and add your script url to the blocks
try_email (1).aia (3.0 KB)




function doGet(e) {
  var email = e.parameter.email;
  var otp = Math.floor(100000 + Math.random() * 900000).toString(); // Generate a 6-digit OTP

  // Open the Google Sheet to store OTPs
  var sheet = SpreadsheetApp.openById('your sheet id').getSheetByName('Sheet1');
  
  // Save the OTP in the sheet along with the email
  sheet.appendRow([email, otp, new Date()]);

  var subject = "Your OTP Code";
  var body = "Your OTP code is: " + otp;

  // Send email
  MailApp.sendEmail(email, subject, body);

  // Return a response
  return ContentService.createTextOutput();
}


function verifyOtp(email, otp) {
  // Open the Google Sheet to verify OTPs
  var sheet = SpreadsheetApp.openById('your sheet id').getSheetByName('Sheet1');
  var data = sheet.getDataRange().getValues();

  for (var i = 0; i < data.length; i++) {
    if (data[i][0] == email && data[i][1] == otp) {
      // OTP verified, you may consider removing the OTP for security
      sheet.deleteRow(i + 1); // Remove the row after verification
      return "OTP verified!";
    }
  }
  return "Invalid OTP!";
}

function doPost(e) {
  var email = e.parameter.email;
  var otp = e.parameter.otp;

  // Call the verify function
  var result = verifyOtp(email, otp);
  
  return ContentService.createTextOutput(result);
}
function doGet(e) {
  var email = e.parameter.email;
  
  if (!email) {
    return ContentService.createTextOutput(
      JSON.stringify({ status: "error", message: "Email is required." })
    ).setMimeType(ContentService.MimeType.JSON);
  }

  var otp = Math.floor(100000 + Math.random() * 900000).toString(); // Generate 6-digit OTP

  // Open Google Sheet
  var sheet = SpreadsheetApp.openById('SHEET_ID').getSheetByName('Sheet1');

  // Append email, otp, timestamp
  sheet.appendRow([email, otp, new Date()]);

  // Send OTP via email
  var subject = "Your OTP Code";
  var body = "Your OTP code is: " + otp;
  MailApp.sendEmail(email, subject, body);

  // Return success message
   return ContentService.createTextOutput("OTP sent to " + email);
}

function verifyOtp(email, otp) {
  var sheet = SpreadsheetApp.openById('SHEET_ID').getSheetByName('Sheet1');
  var data = sheet.getDataRange().getValues();

  for (var i = 0; i < data.length; i++) {
    var sheetEmail = String(data[i][0]).toLowerCase().trim();
    var sheetOtp = String(data[i][1]).trim();

    if (sheetEmail === email.toLowerCase().trim() && sheetOtp === String(otp).trim()) {
      sheet.deleteRow(i + 1); // Remove the row once verified

       return ContentService.createTextOutput("SUCCESS ");
    }
  }

   return ContentService.createTextOutput("INVALID OTP");
}

function doPost(e) {
  var email = e.parameter.email;
  var otp = e.parameter.otp;

  if (!email || !otp) {
     return ContentService.createTextOutput("EMAIL & OTP ARE REQUIRED");
  }

  return verifyOtp(email, otp);
}

I have tested this code, and works well.

to send OTP used doGet

to verify OTP used doPost

to avoid further confusion, after verify the otp and the email id is deleted from the sheet