Why I do not recieve email confirmations after user signing up?

I’m building an app that requires user authentication and user verification (I’m using the default users-permissions user and extend it further)

And I have this code which after completely filling the form out there a button that will trigger the onSubmit function below.

and what this function (should) do is sending the data to the database and there will be timeout to sent an email verification.

But I encountered a Problem:
-I don’t actually receive any email in my Inbox and also I get a server error
AM I doing this wrong?

This topic has been created from a Discord post (1253329101197017098) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord

I have in an onSubmit function that has the request that handles the user registration and the email sending

const fullData = {
  ...data,
  role: 1,
  email: data.email,
  password,
  username: data.name,
  phone: data.Tel,
  cabinetName: data.nom_cabinet,
  siretNumber: data.siret,
  location: [
    {
      Address: data.Adresse,
      Office: data.bureau,
      zipCode: data.Code_postal,
      city: selectedCityName,
      department: data.departement,
      country: Country.getCountryByCode(selectedCountryIsoCode as string)
        ?.name,
      State: selectedState?.name, // Use state name here
    },
  ],
};

if (!password) {
  setError("Missing password");
  setIsLoading(false);
  return;
}

setTimeout(async () => {
  try {
    const strapiResponse = await axios.post(
      "http://localhost:1337/api/auth/send-email-confirmation",
      {
        email,
      },
      {
        headers: {
          "Content-Type": "application/json",
        },
      }
    );

    console.log("Strapi response:", strapiResponse);
  } catch (error) {
    console.error("Error sending email confirmation:", error);
  }
}, 2000);

try {
  const response = await axios.post(
    "http://localhost:1337/api/auth/local/register",
    fullData
  );

  setToken(response.data.jwt);
  setUser(response.data.user);
} catch (err) {
  if (err instanceof AxiosError && err.response) {
    setError(err.response.data.error.message);
  } else {
    setError("Registration failed. Please check the server logs.");
  }
  setIsLoading(false);
  return;
}

navigate("/cabinet"); // Navigate to the dashboard or another route
setIsLoading(false);

Also I configured this inside my Strapi Admin dashboard
along with inside my code (which seems useless if it is configured inside my Strapi admin dashboard)
I set up the plugin file and made a constum email confirmation file

I need help and thank you!!! :hugs:

<@300924977669210112> are you able to fix the issue since i am also in the same problem