We are seeing an exception “Object has been disposed” when calling com.aspose.email.SmtpClient.send. Using aspose.email for java 17.4.0.
public SmtpClient getSmtpClient() {
if (smtpClient == null) {
smtpClient = new SmtpClient(propertiesUtils.getSmtpClientHost(),
propertiesUtils.getSmtpClientPort(), propertiesUtils.getSmtpClientUserName(), propertiesUtils.getSmtpClientPassword(),
SecurityOptions.Auto);
}
return smtpClient;
}
public void send(MailMessage emailMessage){
try {
getSmtpClient().send(emailMessage);
Any ideas what we might be doing wrong?
com.comcast.sa.esl.emailoutbound.services.SmtpEmailClient.send - Exception in send: Object has been disposed. ERROR_DETAILS: com.aspose.email.AsposeException: Object has been disposed. at com.aspose.email.cm.b(SourceFile:146) at com.aspose.email.gv.a(SourceFile:95) at com.aspose.email.cy.a(SourceFile:375) at com.aspose.email.cy.w(SourceFile:350) at com.aspose.email.SmtpClient.a(SourceFile:1864) at com.aspose.email.SmtpClient.a(SourceFile:1819) at com.aspose.email.SmtpClient.send(SourceFile:1638) at com.comcast.sa.esl.emailoutbound.services.SmtpEmailClient.send(SmtpEmailClient.java:77) at com.comcast.sa.esl.emailoutbound.services.EmailOutboundService.process(EmailOutboundService.java:323) at com.comcast.sa.esl.emailoutbound.services.EmailOutboundService$$FastClassBySpringCGLIB$$10450722.invoke() at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)