Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: connect ENOENT alt1.gmail-smtp-in.l.google.com #1183

Open
SabiulSabit opened this issue May 7, 2024 · 1 comment
Open

Error: connect ENOENT alt1.gmail-smtp-in.l.google.com #1183

SabiulSabit opened this issue May 7, 2024 · 1 comment

Comments

@SabiulSabit
Copy link

SabiulSabit commented May 7, 2024

I am getting ENOENT alt1.gmail-smtp-in.l.google.com error while sending mail

image

It was working as expected but suddenly it stopped working and throwing the above error

jobs.module.ts

  imports: [
    MailerModule.forRoot({
      transports,
      template: {
        dir: join(__dirname, 'mail-templates'),
        adapter: new HandlebarsAdapter(),
        options: {
          strict: true,
        },
      },
    }),
   
  ],
...
})

export class JobsModule { }

transports object

  security: {
    host: process.env.EMAIL_SMTP_HOST,
    secure: false,
    auth: {
      user: process.env.SECURITY_EMAIL,
      pass: process.env.SECURITY_EMAIL_PASSWORD,
    },
  },
  notifications: {
    host: process.env.EMAIL_SMTP_HOST,
    secure: false,
    auth: {
      user: process.env.NOTIFICATIONS_EMAIL,
      pass: process.env.NOTIFICATIONS_EMAIL_PASSWORD,
    },
  },
  support: {
    host: process.env.EMAIL_SMTP_HOST,
    secure: false,
    auth: {
      user: process.env.SUPPORT_EMAIL,
      pass: process.env.SUPPORT_EMAIL_PASSWORD,
    },
  },
};

Mail Service

  async sendMail() {
    try {
        this.mailerService.sendMail({
          ...mailCofig
        }).catch(async err => {
          console.log('Error in mail sending', JSON.stringify(err));
          console.trace(err);
        });
   
    } catch (err) {
      console.log('Error while sending email', JSON.stringify(err));
      console.trace(err);
    }
  }
@MuhammadSaidulislam
Copy link

I am also facing the same issue.
Last few days trying to solve the issue but i didn't find any solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants