• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

problem in sending mail

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I am trying to write a simple java program to send email using JavaMail API.
I have put mail.jar in my class path and used the following code for the same.



When i try to compile the above code , i get the following compilation error.




I can not understand why this error is coming.i manually tested the connectivity with our mail server using ping utility.But i am not sure why i am not able to connect to port 25(SMTP) . Can any body predict why this error is coming and suggest a solution?
 
Ranch Hand
Posts: 646
Mac
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your code is correct.
You need to talk to admin person to check whether your machine is allowed to send mail.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


i manually tested the connectivity with our mail server using ping utility.But i am not sure why i am not able to connect to port 25(SMTP)


Can you telnet to that machine on that port?
 
Saravanan Thirugnanam
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Can you telnet to that machine on that port



No, when i try to telnet to that machine on port 25 , it is not connected.But if i use ping utility to test connection with that machine it is giving reply.

My machine is connected to internet through proxy server.Is this a problem in sending mail?
 
Rancher
Posts: 43024
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ping just checks that the machine is up and running, and listening to the network. If you can't connect to port 25, that port may be blocked somewhere in between, or the mail server is down or doesn't accept connections from the machine you're trying this from.
You said that your mail client running on the same machine does not have problems connecting to that machine? That would be odd indeed.
 
Saravanan Thirugnanam
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

You said that your mail client running on the same machine does not have problems connecting to that machine?



yes, A mail client(Lotus Notes) is running in the same machine which is connected to that machine through which we send and receive our corporate mails. But i can not programmatically connect to that machine on port 25.
Do i need to do any configuration in mail server to accept connection from my machine or is there any problem in sending mails from a system which is behind the firewalls?
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check your Notes client configuration. Somewhere it is likely to describe its connection parameters (sorry, can't suggest where - I haven't used Notes in six years). Perhaps you are connecting to the wrong machine, or there are extra authentication steps needed.

(Long shot: make sure your email server is running Domino 4.5 or above, previous versions didn't support SMTP)
 
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

The port 25 is usually blocked by the SMTP/POP3 server and checkbox is usually set. Tell your Administrator to uncheck this. Normally this port is blocked as part of the 6 port blocking rules as set in the virusscan console of the POP3/SMTP Server for your IP address/machine.

Even if you uncheck the box, it re-checks the status of blocking this port after a pre-determined time.

The process has to be repeated after every "n" hours or so.

Rgds,

Seetesh
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have the exact same problem.
I have also verified that I can send email through my SMTP server on port 25 using Outlook - but not programatically using Java :-(

Did you solve this?
 
You will always be treated with dignity. Now, strip naked, get on the probulator and hold this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic