Next.js Discord

Discord Forum

NexAuth Magic link and aws SES

Unanswered
Silky ant posted this in #help-forum
Open in Discord
Silky antOP
Hi,

I followed the steps for SES:

1. Created an email identity.
2. Verified the email by clicking on the link they sent me.
3. Created a user with the following permissions: AmazonSesSendingAccess (+ AmazonSESFullAccess).

Then, in NextAuth, I entered the credentials of this user (EMAIL_SERVER_USER + EMAIL_SERVER_PASSWORD) and used the email I verified (EMAIL_FROM) with the host (EMAIL_SERVER_HOST = "email-smtp.eu-north-1.amazonaws.com") and port (EMAIL_SERVER_PORT = 587) (I also tested with port 465).

Test config:
1-
EmailProvider({
    server: `smtp://${process.env.EMAIL_SERVER_USER}:${process.env.EMAIL_SERVER_PASSWORD}@${process.env.EMAIL_SERVER_HOST}:${process.env.EMAIL_SERVER_PORT}`,
    from: process.env.EMAIL_FROM
})


OR 2-
EmailProvider({
    server: {
        host: process.env.EMAIL_SERVER_HOST,
        port: parseInt(process.env.EMAIL_SERVER_PORT as string, 10),
        auth: {
            user: process.env.EMAIL_SERVER_USER,
            pass: process.env.EMAIL_SERVER_PASSWORD,
        },
    },
    from: process.env.EMAIL_FROM
})


No matter what I try, the email is never sent, and I don't see any errors in my console.
I tried with Resend, and it works right away, but I really want to use SES.
Thanks for your time. Have a great day !

PS: I’m not sure where the issue comes from, whether it’s with NextAuth that I don't fully understand or with SES that’s misconfigured on AWS. I posted the issue in both servs, sorry if you see it multiple times 😅

1 Reply

Silky antOP
/solve