Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

277
Visualizações
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.

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

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

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda