There is a script called lemmy easy deploy.
https://github.com/ubergeek77/Lemmy-Easy-Deploy/tree/main
You would setup the free plan for sendgrid.com
Their server setting are an ID, password, servernane and port you would put in the config file.
https://github.com/ubergeek77/Lemmy-Easy-Deploy/blob/main/config.env.example