Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

400
Vistas
How to get Server ip address to send in mail in nodejs

I am using nodemailer to send mails in nodejs. I am embedding hyperlink to mailbody it is working fine.

My sample mailbody is below

 `This is confirmation mail.\n
                       please click below link to login
              http://${req.headers.host}/login\n\n
              \n`

Observe the scenario, If i open my page as localhost:port it is sending mail with localhost:port when I open with Ipaddress:port then it is sending with Ipaddress:port.

Here comes the my problem I got mail successfully,now I opened my mail in another system and from there I click on the link then it is getting the server can't be reached. This is quite straight forward as the server is running on another machine but I am trying to open in different machine with locahost.

So how can i send the server ip address in that mail. I have also seen about server.address().address but how to use I got confused.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

are you using ExpressJs you can use use this req.hostname on nodejs Server try this and let me know if works or req.ip

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda