#Invalid login: 534-5.7.9
1 messages · Page 1 of 1 (latest)
@Module({
imports: [
ConfigModule.forRoot({
envFilePath: '.env',
isGlobal: true,
}),
MailerModule.forRoot({
transport: {
host: process.env.MAIL_HOST,
auth: {
user: process.env.MAIL_USER,
pass: process.env.MAIL_PASSWORD,
},
},
defaults: {
from: `from ${process.env.MAIL_FROM}`,
},
}),
MongooseModule.forRoot(process.env.DB_URL),
AuthModule,
MailModule,
],
})
export class AppModule {}
import { Injectable } from '@nestjs/common';
import { MailerService } from '@nestjs-modules/mailer';
interface WelcomeEmailContext {
name: string;
}
@Injectable()
export class MailService {
constructor(private readonly mailerService: MailerService) {}
async sendEmail() {
await this.mailerService.sendMail({
to: '[email protected]',
subject: 'Hello :D',
text: 'Welcome',
html: '<b>Welcome</b>',
});
}
}
This is the service that send the email
@Controller('auth')
export class AuthController {
constructor(private mail: MailService) {}
@Post('/sign-up')
async signUp() {
await this.mail.sendEmail();
return ':D';
}
}
Suggestion for @scenic zenith:
:warning: Please do not screenshot code as it causes a number of issues:
- Ease of assistance - If someone wants to copy your code and correct it, they cannot. Making it easy for people to help you is in your best interests.
- Editorializing - It's common to try to make images small, which means you're likely to crop out code relevant to your issue
- Accessibility - Wide images can be hard to read on mobile devices, and are impossible for screen readers.
- Legibility - You cannot read screenshots of code directly, instead you have to open them in an enlarged context.
- Bandwidth usage/clutter - Some of our members use metered connections, and it is wasteful for them to download images of text.
For a small amount of code please use a code-block (/rules codeblocks).
Nodemailer is a module for Node.js to send emails