In article <0000005b...@usw-ex0108-192.remarq.com>, kpalania
Thank you.
JAF should be all you need. Last time I looked (1.0) the POP3 transport
protocol package was separate, but they may have integrated it by now.
> Also, what value does the smtpHost variable take, in
>the statement below:
>transport.connect(smtpHost, "", "");
You need to have a mail server host for your outgoing mail, typically a
hostname supplied by your ISP. If you run any other mail service on the same
machine you can probably figure out the hostname (I had to look at my Netscape
preferences since I'd forgotten the exact name).
If you are writing something that has to be portable, it's fairly
straightforward if you're just having people send bug reports to you: just
pick the hostname part of your usual mailbox address. If it has to work
everywhere, you probably need to supply a way for users to set the SMTP host.
--
"Yo' ideas need to be thinked befo' they are say'd" - Ian Lamb, age 3.5
http://www.cs.queensu.ca/~dalamb/
DEBUG: not loading system providers in <java.home>/lib
DEBUG: not loading optional custom providers file: /META-
INF/javamail.providers
DEBUG: successfully loaded default providers
DEBUG: Tables of loaded providers
DEBUG: Providers Listed By Class Name:
{com.sun.mail.smtp.SMTPTransport=javax.mail.Provi
r[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun
Microsystems, Inc], com.sun.mail.im
IMAPStore=javax.mail.Provider
[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems,
c]}
DEBUG: Providers Listed By Protocol: {imap=javax.mail.Provider
[STORE,imap,com.sun.mail.i
p.IMAPStore,Sun Microsystems, Inc], smtp=javax.mail.Provider
[TRANSPORT,smtp,com.sun.mail
mtp.SMTPTransport,Sun Microsystems, Inc]}
DEBUG: not loading optional address map file: /META-
INF/javamail.address.map
DEBUG: getProvider() returning javax.mail.Provider
[TRANSPORT,smtp,com.sun.mail.smtp.SMTP
ansport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth false
DEBUG: SMTPTransport trying to connect to host "company.com",
port 25
--Exception handling in msgsendsample.java
javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.MessagingException: Unknown SMTP host:
company.com;
nested exception is:
java.net.UnknownHostException: company.com
at javax.mail.Transport.send0(Transport.java:218)
at javax.mail.Transport.send(Transport.java:80)
at msgsendsample.main(msgsendsample.java, Compiled Code)
Exception in thread "main" java.lang.ClassCastException
at msgsendsample.main(msgsendsample.java, Compiled Code)