Hi.
Mailer works perfectly when I start the app locally with the below command.
"start": "ts-node -r tsconfig-paths/register src/main.ts",
But the mail is not sent out if I start the app with the below command.
"prestart:prod": "rimraf dist && npm run build",
"start:prod": "node dist/main.js",
{
"name": "a",
"version": "0.0.1",
"description": "",
"author": "",
"license": "MIT",
"scripts": {
"build": "rimraf dist && tsc -p tsconfig.build.json",
"format": "prettier --write \"src/**/*.ts\"",
"start": "ts-node -r tsconfig-paths/register src/main.ts",
"start:dev": "concurrently --handle-input \"wait-on dist/main.js && nodemon\" \"tsc -w -p tsconfig.build.json\" ",
"start:debug": "nodemon --config nodemon-debug.json",
"prestart:prod": "rimraf dist && npm run build",
"start:prod": "node dist/main.js",
"lint": "tslint -p tsconfig.json -c tslint.json",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json"
},
"dependencies": {
"@nest-modules/mailer": "^1.1.3",
"@nestjs/common": "^6.0.0",
"@nestjs/core": "^6.0.0",
"@nestjs/platform-express": "^6.0.0",
"@types/json2csv": "^4.5.0",
"dotenv": "^8.0.0",
"json2csv": "^4.5.1",
"moment": "^2.24.0",
"nest-schedule": "^0.6.0",
"nodemailer": "^6.3.0",
"reflect-metadata": "^0.1.12",
"rimraf": "^2.6.2",
"rxjs": "^6.3.3"
},
"devDependencies": {
"@nestjs/testing": "^6.0.0",
"@types/express": "^4.16.0",
"@types/jest": "^23.3.13",
"@types/node": "^10.12.18",
"@types/supertest": "^2.0.7",
"concurrently": "^4.1.0",
"jest": "^24.9.0",
"nodemon": "^1.19.1",
"prettier": "^1.15.3",
"supertest": "^3.4.1",
"ts-jest": "^24.0.2",
"ts-node": "8.1.0",
"tsconfig-paths": "3.8.0",
"tslint": "5.16.0",
"typescript": "3.4.3",
"wait-on": "^3.2.0"
},
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": "src",
"testRegex": ".spec.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"coverageDirectory": "../coverage",
"testEnvironment": "node"
}
}
@Module({
imports: [
HttpModule,
MailerModule.forRoot({
transport: {
secureConnection: false,
host: 'smtp.office365.com',
port: '587',
auth: { user: '[email protected]', pass: 'password' },
tls: { ciphers: 'SSLv3' },
},
template: {
dir: __dirname + '/templates',
adapter: new HandlebarsAdapter(), // or new PugAdapter()
options: {
strict: true,
},
},
}),
],
controllers: [
AppController,
],
providers: [
AppService,
],
})