I'm kind of confused about Replit secrets. I tried using it by setting the key
2. Then I tried printing out the value. It worked when I was logged in, but not when I tried to see what would happen if I was logged out. I thought that Replit secrets were so that other people can't see the secret value in the code, but they could still use it?
Think of secrets in this way:
Replit creates a secret and stores it in a box.. The password to that box, is your account, meaning only when you are logged in, then only will you be able to see the value in the box.
But if you print the value, then it is just like as if you have put a sticker on the box saying what is inside the box so anyone can see it, but no one can manipulate it. Replit's job is to keep the secret and protect it. But if you print the value it , creating a secret is completely useless.
Firstly, this method of sending email is unsafe.
The reason you get a key error from another account or if you are logged out is because the replit's algorithm that looks for the secret, is meant to find the secret in your account, not from another user's account, even though the repl but my someone else's. If you want to send an email, create a throwaway account on Gmail, and use it to send emails.