Closed v3nt closed 1 year ago
Trying to send an email from a form in our nuxt app.
Installed as requested and trying to test it locally at the moment.
Request URL: http://localhost:3000/mail/send Request Method: POST Status Code: 400 Bad Request Remote Address: 127.0.0.1:3000 Referrer Policy: strict-origin-when-cross-origin
modules: [ '@nuxtjs/style-resources', 'cookie-universal-nuxt', '@nuxtjs/axios', [ 'nuxt-mail', { message: { to: 'dan@test.net', }, smtp: { host: 'localhost', port: 587, }, }, ], ],
Using Composition API & typescript.
const { $axios } = useContext(); // ... async function sendFeedback() { await $axios({ method: 'POST', url: `/mail/send`, data: { to: 'dan@test.net', from: 'John Doe', subject: 'Incredible', text: 'This is an incredible test message', }, }); }
onMounted(() => { sendFeedback(); });
Is any other setup required? Its not clear to me if or what we need to setup for the smtp config.
You will need a valid SMTP server config, may be? Are you hosting an SMTP server locally? Is it up? Try using an external SMTP server as a work-around.
Trying to send an email from a form in our nuxt app.
Installed as requested and trying to test it locally at the moment.
error
nuxt.config
in default.vue
Using Composition API & typescript.
Is any other setup required? Its not clear to me if or what we need to setup for the smtp config.