Yep, I think my only problem is getting an Authenticator object - are there any subclasses already, or do I need to create one?
b2 - benbiddington@surf4nix.com
You will have to subclass the Authenticator object yourself as there are no subclass included in the JavaMail package. Remember to include the method getPasswordAuthentication() as well
Regards,
Leon If you need additional help, you can email to me at zaoliang@hotmail.com I don't guaranty that I will be able to solve your problems but I will try my best
Yes I have done this, the thing is, though it is called an abstract class right, it has no abstract methods - so why have they called it abstract? To force subclassing yes, but I thought it had to have atleast one abstract method? So my question is really - is abstract an optional modifier?
My next step is to try sending mail from a Servlet. So do you think I can try it without an Authenticator, can I just access my smtp server from a remote site like that? Or is this where I need to use passwords? Also, do you ever need an Authenticator to access an smtp server?
Seriously speaking, I haven't done any abstract classes before besides on RMI so I am unable to comment on that.
From what I know, there is no need to use the Authenticator at all. I used to be able to send an email without using the Authenticator class. I did it in a lab, which was connected to the server as a whole Network. However I did encounter some problems when I tried embeding it into a servlet or applet (It happened sometime ago so I forgot which it was)
Good luck,
Leon If you need additional help, you can email to me at zaoliang@hotmail.com I don't guaranty that I will be able to solve your problems but I will try my best
I think you're right - it is strange how no password is required when accessing an smtp server? But in order to recieve, you do.
Does this imply that I could choose any smtp server I like to send mail thru - or is this simply because I am logging in to my ISP to access the smtp, and it implicitly knows who I am?
I think I'll try it with some other server, and see what happens ;-) P.S. I guess abstract is an optional modifier.
b2 - benbiddington@surf4nix.com
I have never tried receiving an mail using JavaMail before so I am not sure whether there is a need to authenticate yourself.
I am also not too sure on how the retrieving and sending of mails work in JavaMail so all I can say is you will have to keep trying
Good Luck,
Leon If you need additional help, you can email to me at zaoliang@hotmail.com I don't guaranty that I will be able to solve your problems but I will try my best
Here's a weird thing you may be able to explain to me. I have this servlet which sends mail right, and thru the code for debugging purposes I have placed markers.
After an important action is performed in the code, I put a call like this:
which just helps me debug. Well a weird thing is happening, where by - if I go back to the form submission page, and enter another message - then the string comes back longer than before - so it has remembered the concat() I did last time? I guess this is something to do with session timeouts?
But even when I close the browser, then go back to it - the string remains at it's last value?
Another aside - I create an InternetAddress with the input string - but it will not throw an exception, as hard as I try - why is that? ;-)
b2 - benbiddington@surf4nix.com
Also, I am running my servlets on JRun (Allaire). It seems that this is one of those which does not destroy Servlets until they are shutdown - hence my problems with data persistence, this has benefits though I am sure!
Now I find I set up my mesage to send, from a web page on my personal server - click send, and it works perfectly - unless I stop it connecting to the internet to send it.
If I do this I get a MessagingException - to be expected surely, yes, but then every time I try to re-send after that, no logging on even gets attempted - iy goes straight to exception? this is weird.
b2 - benbiddington@surf4nix.com
"I think you're right - it is strange how no password is required when accessing an smtp server? But in order to recieve, you do."
This is because when you send, the server just checks your account name against the list of authorized users and if it's there, sends it. However, more and more servers are requiring passwords to send, to prevent spammers from guessing an account name and using the email service for their own ends.
To receive, well, anyone who's ever received an email from you probably knows your account name (it's usually the same as your email addy). So obviously, you need to check the password to prevent people reading email they aren't supposed to.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.