Problem to send email with mailtrap using Docker(Mongodb)

Asked

Viewed 61 times

0

I am studying the development of an API and I am having problems using mailtrap to test send email during user validation. The user is written to Mongo but it does not send the email and returns the following error:

Error: connect ECONNREFUSED 127.0.0.1:587
at Object._errnoException (util.js:992:11)
at _exceptionWithHostPort (util.js:1014:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)

I understood that this was a port error and went for answers, I found a solution creating a file called daemon.json inside the /etc/Docker folder with the following DNS content:

    { "dns": ["89.101.160.5", "89.101.160.4"] }

The problem persisted on Ubuntu. I changed machine and on the mac with another Docker account, another container the error persists.

Someone knows a way out?

  • Have you tested Transporter outside the Docker environment? I had a problem with aws sdk in dev environment, just figured out the problem by testing it separately.

  • Do you speak test with a local mongodb? Not yet, I will test and report here.

  • Not exactly, but also, I mean testing the method of sending emails outside of the Docker environment or even creating a method just for sending the email for example. Example

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.