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 install
Create a .env
file and add the following variables:
EMAIL_ADDRESS= #Smtp Email address.
EMAIL_SECRET= #Smtp Password
### Use email from your website
Start the development server on http://localhost:3000
# yarn
yarn dev
# npm
npm run dev
Add 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.