This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Other JSE/JEE APIs and the fly likes JavaMail : Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "JavaMail : "Access not allowed"" Watch "JavaMail : "Access not allowed"" New topic
Author

JavaMail : "Access not allowed"

Edward Chen
Ranch Hand

Joined: Dec 23, 2003
Posts: 798
I want to forward mail through SMTP. but I always have problem. "Access not allowed", but I am sure I put right password there.

Could you give me some hints ?

Thanks




Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Most likely the SMTP server isn't configured to allow your computer to relay messages through it. I would suggest talking to the administrator of the server about that.
Edward Chen
Ranch Hand

Joined: Dec 23, 2003
Posts: 798
Before asking my SMTP server, I want to get help, is my coding right ?

Thanks
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

A cursory glance suggests its OK. But rather than relying on us as a test harness, I'd download Dumbster and test your code with it as your server. That way you will know for sure what are coding errors and what are administration/configuration issues.
[ December 05, 2005: Message edited by: Paul Sturrock ]

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

The code looks "right" in the sense that it compiles and appears to use some APIs in the way their documentation suggests. Whether it will actually work successfully with your server is another question. Most of the JavaMail examples I see that require authentication (which you don't yet know is necessary) use an Authenticator instead of that version of the connect() method. If you haven't seen those examples, there's one here:

http://java.sun.com/developer/onlineTraining/JavaMail/
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JavaMail : "Access not allowed"
 
Similar Threads
Java Mail
Java Mail Problem
Program to send Email using JavaMail not working.
Exception in sending a mail
Sending mail with authentication to Exchange Server 2007