wood burning stoves 2.0*
The moose likes Other JSE/JEE APIs and the fly likes sending mail with JavaMail Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "sending mail with JavaMail" Watch "sending mail with JavaMail" New topic
Author

sending mail with JavaMail

Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 726
Please correct me where I am wrong?



Thanks & best regards
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

What is happening? What do you expect to happen/what is going wrong? Is there any error message? Can you post it if there is?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 726
Paul Sturrock wrote:What is happening? What do you expect to happen/what is going wrong? Is there any error message? Can you post it if there is?

I was using the following code on my previous server and that was working very well



Now on the new server it displays following error:
*javax.mail.SendFailedException: Invalid Addresses;*
*nested exception is:*
* com.sun.mail.smtp.SMTPAddressFailedException: 553 sorry, that domain isn't in my list of allowed rcpthosts (#5.5.3 - chkuser)*

I edited my /var/qmail/control/rcpthosts and inserted my whole domain names but still I am receiving the same error. My network company replied me that previous server was using the open relay but now we have to change the code to send the emails by giving username/pass then I got help with the JavaMail FAQs and written the code above but not working with same error

How can I resolve the issue?

Thanks and best regards

Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 726
I updated my code by searching some articles but throwing the following error:
non-static variable this cannot be referenced from a static context
Authenticator auth = new SMTPAuthenticator();




Thanks & best regards

 
 
subject: sending mail with JavaMail
 
Similar Threads
Java Mail API not connecting me from my tomcat server
NoClassDefFoundError JavaMail..........
java mail throws
Trying to implement a mail queue in JavaMail using ExecutorService
AuthenticatedFailedException is thrown javamail