gatsby send email using php
CopyhandleForm.js: copy code to clipboardconst bodyParser = require("body-parser")const express = require("express")const nodemailer = require("nodemailer")const app = express()app.use(bodyParser.urlencoded())const contactAddress = "[email protected]"const mailer = nodemailer.createTransport({ service: "Gmail", auth: { user: process.env.production.GMAIL_ADDRESS, pass: process.env.production.GMAIL_PASSWORD, },})app.post("/contact", function (req, res) { mailer.sendMail( { from: req.body.from, to: [contactAddress], subject: req.body.subject || "[No subject]", html: req.body.message || "[No message]", }, function (err, info) { if (err) return res.status(500).send(err) res.json({ success: true }) } )})app.listen(3000)
Also in JavaScript:
- make string json object vue
- react native clear cach
- js months ago
- js remove first and last element from array
- NullInjectorError: R3InjectorError(DashboardModule)[DatabaseService -> DatabaseService -> HttpClient
- jquery get aria-label value
- capture enter button react input
- how to install chalk in node js
- javascript create json object from array
- toastr.js notification for laravel
- button not clicking for random jokes in javascript
- criar objeto javascript
- react useref in useeffect
- reactjs app change port
- react enzyme mount ReferenceError: is not defined
- jquery detect nav tab change event
- jstree expend all node
- jquery loop each tr in table grepper
- async function fetchJson
- create react app and tailwind
- generate random number jquery
- clearing cookie in js
- DNS_PROBE_FINISHED_NXDOMAIN node.js
- how to solve Could not write JSON: Infinite recursion (StackOverflowError)