• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem in sending the mail to PostCast server

 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

When i am sending the mail to PostCast Server i am getting the Exception

javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.MessagingException: Could not connect to SMTP host: localhost
, port: 25;
nested exception is:
java.net.ConnectException: Connection refused: connect
at javax.mail.Transport.send0(Transport.java:219)
at javax.mail.Transport.send(Transport.java:81)
at MsgSend.main(MsgSend.java:24)


while the same program runs fine on other system .........please tell me wat is the problem i also disabled the firewall and antivirus still not working for me











 
best scout
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Obviously your application or application server is configured to use localhost as SMTP gateway. But "connection refused" usually means that there is no socket opened for localhost on port 25, i.e. there is no SMTP server running.

I guess on the other systems for which it works as expected there is a local SMTP server running or the application server is configured to use another existing SMTP server.

Marco
 
Neeraj jain
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So please tell me what is the solution
 
Marco Ehrentreich
best scout
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From your description we have no idea what your software does or how the whole setup looks. So I can only guess what could be a solution.

1.) The easiest solution would probably be to install an SMTP server on the machine where you want to run the application. On Linux this is usually done out of the box, so I suspect you are not running on Linux. Unfortunately I don't what free SMTP servers you could use for Windows, but I'm sure there will be some.

2.) The second solution could be to configure another SMTP server in your application server. But this would require an existing SMTP which allows to relay mails from your application. Of course I don't know if you have such an existing SMTP gateway at hand. The actual configuration depends on the application server used but you should find the relevant information in its documentation.

Marco
 
Neeraj jain
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can you tell me the good SMTP server and please don't tell some complex ones as i am in an initiative stage
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why don't you run the code on that other machine that already has a mail server up and running? You don't really want to run a mail server on your desktop machine anyway, or do you?
 
Neeraj jain
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am just learning to send mail through my application dat is why need to hav a smtp server on my machine
reply
    Bookmark Topic Watch Topic
  • New Topic