Error : Relaying denied. IP name lookup failed [IP-Address]

Posted April 8, 2014 9.4k views
Here I am trying to send mail using Java Mail API. When I am trying to test this to send mail to users from my office public IP address, it works but when I deploy my application to main server then it fails to send the mail, simply getting error message "Relaying denied. IP name lookup failed [IP-Address]" Here all articles says you have to allow relay from certain hosts is to add those hosts to /etc/mail/local-host-names You just need to make those changes to the mailserver that is running on your droplet. Can you guys help me , where I have to configure this ??

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer
Could you provide some more details about your set up? What kind of SMTP server are you trying to relay through? Is it something you control or an ISP's?

From your droplet, can you run:

telnet the.smtp.server.domain 25