I am getting this error on executing the email sending code using webtop 6.7
My ERROR:
javax.mail.SendFailedException: Sending failed;nested exception is:class javax.mail.MessagingException: 530 5.7.1 Client was not authenticated
MY CODE:
Properties props = new Properties();
//props.setProperty("mail.transport.protocol", "smtp");
System.out.println(new DfTime().toString() +" - PRINT : "+ RexConstants.DOCBASE_NAME +" - EmailUtils : onInit() SendMessage :");
props.setProperty("mail.host", RexConstants.SMTP_HOST);
try {
Session session = Session.getDefaultInstance(props, null);
Message msg = new MimeMessage(session);
//session.setDebug(debug);
msg.setFrom(new InternetAddress(from));
InternetAddress[] addressTo = new InternetAddress[recipients.length];
for (int i = 0; i < recipients.length; i++) {
addressTo[i] = new InternetAddress(recipients[i]);
System.out.println(new DfTime().toString() +" - PRINT : "+ RexConstants.DOCBASE_NAME +" - EmailUtils : onInit() recipients : "+i+" "+recipients[i]);
}
msg.setRecipients(Message.RecipientType.BCC, addressTo);
// Set the subject of the email message
msg.setSubject(subj);
// Add the email message
msg.setContent(body, "text/plain");
msg.setDataHandler(new DataHandler(new ByteArrayDataSource(body, "text/plain")));
if (pFlg)
msg.setHeader("X-Priority", "1");
Transport.send(msg);
What client is the error exaclty talking abt?
Is it a version mismatch error.I am moving the code from 5.3 to 6.7 CS and Webtop
Thanks in advance !!!