Error when copying the Send emails from Workers (beta) tutorial

I have tried copying the “Send emails from Workers (beta)” tutorial and on deployment I am getting a Cannot read properties of undefined (reading 'send') error.

I’ve debugged and can confirm it’s the await env.SEB.send(message); line that’s throwing the exception.

Is there a step missing from the tutorial?

I am not familiar with env.SEB to be able to debug further.


SEB, in that example, is the name of the binding you created in your wrangler.toml

send_email = [
{type = "send_email", name = "SEB"}

You can change the name to whatever you want, in this example I believe they were just using SEB to stand for “Send Email Binding”.
Did you define that binding in your wrangler.toml?

Once you know it looks very obvious, thanks a lot!!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.