InfoCenter Home >
4: Developing applications >
4.6: Java Technologies >
4.6.1: Using JavaMail >
4.6.1.3: Debugging JavaMail
4.6.1.3: Debugging JavaMail
There will be times when you need to debug your JavaMail applications.
One option is to turn on JavaMail's debugging feature. With this option on,
JavaMail will print to stdout its interactions with the mail servers.
These interactions are printed in detail, in a step-by-step format.
With WebSphere Application Server,
stdout and stderr are usually redirected to files.
The specific file paths can be set with an application server's Properties > File panel.
For example, for the Default Server, stdout is redirected by default
to the file:
<WAS_HOME>\logs\default_server_stdout.log
See the Problem determination section for more
information on stdout and stderr.
Enable debugging programmatically,
through the console,
or through the command line.
The output in stdout looks like the following example:
...
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp]
DEBUG SMTP: useEhlo true, useAuth false
DEBUG: SMTPTransport trying to connect to host "smtp3.eedge.com", port 25
DEBUG SMTP RCVD: 220 relay14.eedge.com ESMTP Sendmail; Tue, 19 Dec 2000 15:08:42 -0700
DEBUG: SMTPTransport connected to host "smtp3.eedge.com", port: 25
DEBUG SMTP SENT: EHLO y2001
DEBUG SMTP RCVD: 250-relay14.eedge.com Hello testpc.eedge.com, pleased to meet you
250-8BITMIME
250-SIZE 20000000
250-DSN
250-ONEX
250-ETRN
250-XUSR
250 HELP
DEBUG SMTP SENT: MAIL FROM:<alice@mail.eedge.com>
DEBUG SMTP RCVD: 250 <alice@mail.eedge.com>... Sender ok
DEBUG SMTP SENT: RCPT TO:<bob@coldmail.net>
DEBUG SMTP RCVD: 250 <bob@coldmail.net>... Recipient ok
Verified Addresses
bob@coldmail.net
DEBUG SMTP SENT: DATA
DEBUG SMTP RCVD: 354 Enter mail, end with "." on a line by itself
DEBUG SMTP SENT:
...
DEBUG SMTP RCVD: 250 PAA125654 Message accepted for delivery
DEBUG SMTP SENT: QUIT
|
|