Send emails from your Nuxtjs App using Nodemailer. Rich user interface to send emails and attachments.
Make sure to install the dependencies:
# yarn
yarn install
# npm
npm installCreate a .env file and add the following variables:
EMAIL_ADDRESS= #Smtp Email address.
EMAIL_SECRET= #Smtp Password
### Use email from your websiteStart the development server on http://localhost:3000
# yarn
yarn dev
# npm
npm run devAdd enctype='multipart/form-data' to your form
Convert body info new FormData() and use the code below:
fetch("/api/meta", {
method: "POST",
body: formData,
})
.then((res) => res.json())
.then((json) => console.log(json));Note: And email wil be sent to the email address provided in the body of this request.