add sender smtp

This commit is contained in:
faris Aljohari
2024-08-06 14:13:08 +03:00
parent 4e6f254261
commit 3a5c518d11
3 changed files with 3 additions and 2 deletions

View File

@ -10,6 +10,7 @@ export class EmailService {
this.smtpConfig = {
host: this.configService.get<string>('email-config.SMTP_HOST'),
port: this.configService.get<number>('email-config.SMTP_PORT'),
sender: this.configService.get<string>('email-config.SMTP_SENDER'),
secure: this.configService.get<boolean>('email-config.SMTP_SECURE'), // true for 465, false for other ports
auth: {
user: this.configService.get<string>('email-config.SMTP_USER'),
@ -26,7 +27,7 @@ export class EmailService {
const transporter = nodemailer.createTransport(this.smtpConfig);
const mailOptions = {
from: this.smtpConfig.auth.user,
from: this.smtpConfig.sender,
to: email,
subject,
text: message,