I have:
Properties props = new Properties();
props.put("mail.debug", new Boolean(true));
Session session = Session.getInstance(props, null);
session.setDebug(true);
// Create the email message
MultiPartEmail email = new MultiPartEmail();
email.setMailSession(session);
email.send();
log.debug("Mail sent.");
Here is the output:
DEBUG: setDebug: JavaMail version 1.4ea
6588 [main] DEBUG com.secmgmt.picture.four.sqlemail.SqlEmail - Setting host
name to mail.secmgmt.com
6650 [main] DEBUG com.secmgmt.picture.four.sqlemail.SqlEmail - Sending
email via mail.secmgmt.com
DEBUG: getProvider() returning
javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun
Microsystems, Inc.,1.4ea]
DEBUG SMTP: useEhlo true, useAuth false
DEBUG SMTP: trying to connect to host "localhost", port 25, isSSL false
220 sirrus.smc ESMTP Sendmail 8.14.1/8.14.1; Tue, 20 Oct 2009 16:32:02 -0400
DEBUG SMTP: connected to host "localhost", port: 25
I clearly set the host for the email, then the email says localhost. What
am I doing wrong?