Secrets error without having added the Secrets service

I try to send out a email to user, but I got an error, What is the problem? I have no idea about app’s secret .

I can’t reproduce that error. I have tried:

  • sending an email without Secrets
  • storing the email address as a secret, decrypting, then sending an email to that address
  • resetting the encryption key in the Secrets service and sending email
  • deleting the Secrets service, attempting to send the secret email
  • adding the Secrets service back again and sending email

All of this works as expected.

Can you provide more details, or better yet, a clone link of the application?

Possibly related to the following bug reports:

it is not better yet. At the form of Admin, I try to send out notice email to user as long as I enable them. I try to debug by myself, but I have no idea about app’secret. At this stage, I didn’t pay attention to encryption yet. If possible, please help me review it, thanks.! Authentication has been removed, you are free to login as admin by click the link.
Screenshot_23
https://anvil.works/build#clone:YNEC5VYRXFWC5ZRY=LUOTJGQXEKTFNBEBCIDBB7JD

Thanks for sharing. Can you tell me how to produce the error? (which button, form, server function)

I am still not getting the error that you reported above for some reason.

I am able to send and receive the email when clicking the “enabled” checkbox"

sc

That corresponds with your server function:

@anvil.server.callable  
def noticeEmail(to_adr):
  anvil.email.send(from_name="Admin", 
                 to=to_adr, 
                 subject="Welcome",
                 text="Welcome to TicketingCSF!")

(Just as a small change, notice that I used text="Welcome to TicketingCSF!", rather than content="Welcome to TicketingCSF!" which you had)

Am I replicating the same actions that should produce the error?

That is so weird, I modify ‘content’ to ‘text’ in function as well as in data tables of ‘message’. but when I checked the field of ‘enabled’, error still there. By the way, I have no problem of receiving email.

Interesting. Can you try to clone your app (you can click on your own clone link above), and see if the error happens when you are working from the clone?

wow, no problem any more when I am working from clone app, and I receive email too.

1 Like

Great! I think this is a bug that is related to the link above. I am not sure.

@daviesian I’m tagging you here in case this is a bug related to a previous report from David concerning Secrets. The immediate issue has been resolved by cloning.

So now I have to work with the clone one? for my original one still has the problem.

Unless Anvil staff (or someone else) knows how to correct the original issue, you will have to use the clone. I hope that is not too much trouble.

It sure seems like a bug to me, but I could be wrong.

all right, no problem, thank you for your assistance. Hope your team fix it quickly!

1 Like

My pleasure. FYI, I am not Anvil staff, just a regular user.

Really!?:scream: I can’t believe that, I used to say that how lucky Anvil is to have such a dedicated staff like you…thank you so much for your selfless help all the time!

1 Like

Hi @mch8418,

Thanks for reporting this (and thanks to @alcampopiano for your help), it does definitely sound like a bug. In your original app, please can you confirm that you do not have “Use Custom Mail Server” ticked in the Email service? If you tick that, save the app, then untick it, does the problem go away?

That should help us narrow down the problem!

1 Like

Yes, like you said, after unstick ‘use custom mail server’, problem solved! thank you so much!

Great, I’m glad to hear that, sorry it took a while to find. And that will help us make sure it doesn’t happen again.

Update: We’ve tracked this down, it was really just an unhelpful error message that should have read "Send failure. You have enabled Custom SMTP for email sending - did you configure it correctly?". So that is what the error now says :slight_smile:

Thanks to both @mch8418 and @alcampopiano for helping to identify what was going on here.

1 Like

I got that, it is not a typically bug but a failure caused by incorrect configuration. Thank you!