Hi,
We developed simple email sent program using ASPOSE.EMAIL API. When tested java program its working fine.
But we are calling this program through IBM BPM. Here its fails after 23-25 minutes as timeout.
When debug and noticed SmtpClient.send(message); this line gets hung.
We are not sure whats the problem, even if there is a problem it should fail after certain time.
In the code we have smtpClient.setConnectionTimeout(3500);
But its not failing after that time and it took more than 23 minutes to throw timeout error in IBM BPM.
SmtpClient client = new SmtpClient(“smtp.gmail.com”, 587, “abc@gmail.com”, “abc@Password”);
client.setSecurityOptions(1);
MailMessage msg = new MailMessage(“abc@gmail.com”, “abcTest@gmail.com”, “Test First Message from Java”, “Body Test from my local system”);
client.setConnectionTimeout(3500);
client.send(msg);
Let me know how to set specified period if client.send not happens want to throw error and capture error.
In earlier java program we use
Properties props = new Properties();
props.put(“mail.smtp.host”, host);
props.put(“mail.smtp.port”, “587”);
props.put(“mail.smtp.auth”, “true”);
props.put(“mail.smtp.starttls.enable”, “true”);
props.put(“mail.smtps.ssl.trust”, host);
javax.mail.Session session = javax.mail.Session.getInstance(props,
new Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
With ASPOSE not sure how to enable SSL and also set starttls properties value.
Thanks
Arul