This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in sending the mail to PostCast server  RSS feed

 
Neeraj jain
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • 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











 
Marco Ehrentreich
best scout
Bartender
Posts: 1294
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
So please tell me what is the solution
 
Marco Ehrentreich
best scout
Bartender
Posts: 1294
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!