I am doing email code in NodeJS. I am trying to get configurations from Laravel .env file it's not going on. I am trying like this:
MAIL_DRIVER=smtp
MAIL_HOST=smtp.ionos.com
MAIL_PORT=587
MAIL_USERNAME=my_email
MAIL_PASSWORD=my_password
MAIL_ENCRYPTION=null
And accesing it like this:
let transporter = nodemailer.createTransport({
host: process.env.MAIL_HOST,
port: process.env.MAIL_PORT,
secure: false, // true for 465, false for other ports
auth: {
user: process.env.MAIL_USERNAME, // generated ethereal user
pass: process.env.MAIL_PASSWORD // generated ethereal password
}
});