Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JavaMail sending error  RSS feed

 
Farakh khan
Ranch Hand
Posts: 833
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My code




Its sending mails ok if the amount is small but when am start sending emails in loop then sometime it sends and some time throws the following errors:

1) javax.mail.MessagingException: Could not connect to SMTP host: mail.mydomain.com, port: 169, response: -1
DEBUG: setDebug: JavaMail version 1.4ea
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: trying to connect to host "mail.mydomain.com", port 169, isSSL false
DEBUG SMTP: EOF: [EOF]
DEBUG SMTP: could not connect to host "mail.mydomain.com", port: 169, response: -1

2) 511 sorry, can't find a valid MX for rcpt domain (#5.1.1 - chkuser)

3) 451 DNS temporary failure (#4.5.1 - chkuser)

Thanks & best regards
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why or you using port 169? Usually mailservers use port 25.
 
Farakh khan
Ranch Hand
Posts: 833
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Prime wrote:Why or you using port 169? Usually mailservers use port 25.


sorry for late reply

I am using port 169 because most of the servers are rejecting sent mails from port 25

Thanks
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What makes you think that there's a mail server listening on port 169, and if there is one, that it wouldn't reject mails like the ones on port 25 does?
 
Farakh khan
Ranch Hand
Posts: 833
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:What makes you think that there's a mail server listening on port 169, and if there is one, that it wouldn't reject mails like the ones on port 25 does?


You are true its throwing error from both ports.

Looking for solution

Thanks & best regards
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds as if the solution may have nothing to do with Java, but a lot with choosing a mail server that will let you use it. Doesn't your company or ISP have one that you can use? You also have the option of running your own, e.g. Apache James if you want to stay in the Java space.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!