Skip to content

Email

Introduction

This starter kit integrates with Nodemailer for sending emails. You can connect any email provider that supports SMTP with Nodemailer, such as Postmark.

Setup

  1. In the .env file in your project, add your email provider credentials. It should look something like this:
...
# Email
EMAIL_HOST=smtp.example.com
EMAIL_TLS=no
EMAIL_PORT=587
EMAIL_USERNAME=<smtp-username>
EMAIL_PASSWORD=<smtp-password>
...
  • Note: EMAIL_TLS should be either no or yes.
  1. Restart your Astro server in your terminal to apply the changes.

  2. To test your email configuration, go to http://localhost:4321/contact, fill in the form, and submit it. Then, check the inbox that you sent the email to and see if your message is there.

Next Steps

🚀 Congratulations, you’ve successfully set up emails! If you were setting up Lucia authentication, please return to that page to continue with setup. Otherwise, proceed to the next page to continue.