Using Nodemailer with Next.js - how and yes or no?
Answered
Skipjack tuna posted this in #help-forum
Skipjack tunaOP
Hey there,
so I got a typical form on my frontend where a client can basically enter his info, email and a message. Once he submits the form, I want the form content to be sent to a mail address such as info@mydomain.com. How would I do that?
Im quite new to this part of the backend and despite reading a few things here and there, I couldnt wrap my head around it yet. I know that i need a dependency like Nodemailer in the backend. Would that be a good choice? What do you prefer / recommend?
so I got a typical form on my frontend where a client can basically enter his info, email and a message. Once he submits the form, I want the form content to be sent to a mail address such as info@mydomain.com. How would I do that?
Im quite new to this part of the backend and despite reading a few things here and there, I couldnt wrap my head around it yet. I know that i need a dependency like Nodemailer in the backend. Would that be a good choice? What do you prefer / recommend?
Answered by B33fb0n3
yea, I like to use nodemailer for sending emails as well. The easiest thing I like to use from nodemailer is their transport layer to AWS SES: https://www.nodemailer.com/transports/ses/
As you might know: you need a server that sends the mail to the client. And AWS SES ("Simple Email Service") provides that.
See attached:
Red: Providing details from AWS so it uses your account
Orange: Creating the Transport Layer
Green: Sending the actual email
As you might know: you need a server that sends the mail to the client. And AWS SES ("Simple Email Service") provides that.
See attached:
Red: Providing details from AWS so it uses your account
Orange: Creating the Transport Layer
Green: Sending the actual email
4 Replies
@Skipjack tuna Hey there,
so I got a typical form on my frontend where a client can basically enter his info, email and a message. Once he submits the form, I want the form content to be sent to a mail address such as info@mydomain.com. How would I do that?
Im quite new to this part of the backend and despite reading a few things here and there, I couldnt wrap my head around it yet. I know that i need a dependency like Nodemailer in the backend. Would that be a good choice? What do you prefer / recommend?
yea, I like to use nodemailer for sending emails as well. The easiest thing I like to use from nodemailer is their transport layer to AWS SES: https://www.nodemailer.com/transports/ses/
As you might know: you need a server that sends the mail to the client. And AWS SES ("Simple Email Service") provides that.
See attached:
Red: Providing details from AWS so it uses your account
Orange: Creating the Transport Layer
Green: Sending the actual email
As you might know: you need a server that sends the mail to the client. And AWS SES ("Simple Email Service") provides that.
See attached:
Red: Providing details from AWS so it uses your account
Orange: Creating the Transport Layer
Green: Sending the actual email
Answer
@B33fb0n3 yea, I like to use nodemailer for sending emails as well. The easiest thing I like to use from nodemailer is their transport layer to AWS SES: https://www.nodemailer.com/transports/ses/
As you might know: you need a server that sends the mail to the client. And AWS SES ("Simple Email Service") provides that.
See attached:
Red: Providing details from AWS so it uses your account
Orange: Creating the Transport Layer
Green: Sending the actual email
Skipjack tunaOP
Hey, thanks for the reply! Sounds good, and what do you think about Resend? Would you recommend it?
@Skipjack tuna Hey, thanks for the reply! Sounds good, and what do you think about Resend? Would you recommend it?
Yea, I heard about resend and their API looks as easy as the one from nodemailer. Nodemailer does the whole job for me (for all of my emails), so I never tried resend, so I can’t recommend it 🙂