• Post Reply Bookmark Topic Watch Topic
  • New Topic

Could not connect to SMTP host: xxx, port 25

 
Kashmira Patel
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi all,
I am trying to use JavaMail for sending mail, and I see this error when I try to create a connection:

Could not connect to SMTP host: xxx, port 25

On my Windows machine, I figured out that if I disable my anti-virus, it all works fine.
I also have the same app running on a linux server, which does not have anti-virus or firewall. And I am seeing this problem.
Any pointers on what could be wrong?

Thanks,
Kashmira
 
Paul Clapham
Sheriff
Posts: 21884
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It could just be that there is no network path from your Linux server to the machine named "xxx". (Do you really have a server which isn't protected by a firewall? That seems a bit risky to me.)
 
Kashmira Patel
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the response Paul.

The network path is there, I am able to ping the SMTP server.

And I am not very well-versed with linux, I checked the iptables, and that was empty, so I assumed there are no firewalls.
I guess that's because this is just a dev server we are using for now.
 
Paul Clapham
Sheriff
Posts: 21884
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kashmira Patel wrote:The network path is there, I am able to ping the SMTP server.


Good... and can you telnet to it at port 25?
 
Kashmira Patel
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I can telnet, but get kicked out right away.
 
Paul Clapham
Sheriff
Posts: 21884
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good. So now you know the SMTP server is rejecting your connection. Next step is to find out why; ask the administrator of that server.
 
Kashmira Patel
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmm..ok...need to go find out who that is :-)

Thanks a lot, Paul! Will let you know if/when I find out what is causing this.
 
Rob Spoor
Sheriff
Posts: 20820
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some virus scanners (especially McAfee) disallow connecting to an SMTP server because that's what viruses can do. You'll need to enable this. In McAfee (which is what I'm using at work) open the VirusScan Console, double click on "Access Protection", click on "Anti-virus Standard Protection" and uncheck "Block" for "Prevent mass mailing worms from sending email". You will now be able to send emails through code. Be warned that viruses will now also be able to send emails.
 
Kashmira Patel
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob,
I have already disabled the virus scanner in my windows machine and that helped.
My problem is now on a Linux server, which does not seem to have anti-virus or firewall enabled

(Please see the discussion with Paul above)

Thanks,
Kashmira
 
Kashmira Patel
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul,
I could not get to the admin of that particular SMTP server, but I did try another server into which I could telnet successfully from the linux machine (I did not get kicked out) and yet I am getting the same error:
Could not connect to SMTP host.

Now I am really baffled

Thanks,
Kashmira
 
Paul Clapham
Sheriff
Posts: 21884
36
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At this point, since you don't appear to be a networking expert (and neither am I) it looks like you should find somebody who understands how your network is configured and ask them what's going on.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!