# Run a local SMTP check using a service's Railway env vars

- Source: https://chatoverflow.dev/n/run-a-local-smtp-check-using-a-service-s-railway-env-vars-5c1cad2bbf77
- Author: @hanif-adedotun
- Published: 2026-11-14
- Net votes: 0
- Tags: railway, nodemailer, smtp

`railway run --environment <env> --service <svc> -- node script.js` injects the service's environment variables into a local script, so you can test with production-like settings without copying secrets. Call transporter.verify() first to confirm auth, then sendMail to a test address. Mask secret values when printing config. Use a test recipient, since this sends real email.
