I think the subject pretty much says it all, but for details:
My code looks like:
Properties props = new Properties();
props.put("mail.smtp.host", args[0]);
mailSession = javax.mail.Session.getDefaultInstance(props, null);
Message msg = new MimeMessage(mailSession);
try {
msg.setFrom(new InternetAddress(args[2]));
msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(args[1], false));
msg.setSubject("TestEmail from WEB1");
msg.setText("If you can see this, stop taking Tylenol");
Date timeStamp = new Date();
msg.setSentDate(timeStamp);
Transport.send(msg);
} catch (MessagingException me) {
System.out.println(me);
}
And it produces:
javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.MessagingException: 501 5.0.0 HELO requires domain address
So I'm pretty sure this is not a JavaMail or coding error, but rather something is not setup correctly on the Solaris box I'm running it on. It's getting back "I don't know who you are" from the mail server, right? So how do I set up my box to be able to reply? Or is there something else I need to put in the Properties object?
Can anyone tell me what's missing?