Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

398
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!