Re: Sending a mail with java
Tuesday, May 29, 2007 02:00 PM
Well at least you got as far as working code and exception ... I was figuring this was another "how does javamail work" question. Anyway, an SMTP server (such as google) can be configured such that you have to have permission to connect to it. One option is SMTP-level authentication. I didn't see you account for that, and google mail help would probably give you clues if it is required. Another option is a scheme called "POP before SMTP" where you login via POP mode to establish your credentials first, and they are cached ever so briefly for a follow-up SMTP session. More sources of headaches are that Google runs some of their mail services on non-standard ports -- I'm not saying it "isn't" port 25, but saying I'm not sure it "is" either. Best way to know is to open a telnet connection to that server on that port and see what happens. Secondary would be to see how your existing mail client is setup -- server name, port, authentication info, etc.