Below is the sample code,
Blob emlBlob = emailData.getMessageEml(); //blob data from Data base
InputStream emlInputStream = emlBlob.getBinaryStream();
MailMessage eml = MailMessage.load(emlInputStream); //step 1
MailMessage eml = MailMessage.load((“D:/Ershad/mailWithAttachment.eml”)); //step 2
…
SmtpClient client = new SmtpClient(host, port);
client.setSecurityOptions(SecurityOptions.Auto);
client.send(eml);
If using step 2, using directly eml file, iam able send the email successfully
If using step 1, ie when loading the input stream to mail message i am getting the below exception,
Failure sending mail. ERROR_DETAILS: com.aspose.email.SmtpException: Failure sending mail.
at com.aspose.email.SmtpClient.a(SourceFile:1835)
at com.aspose.email.SmtpClient.send(SourceFile:1638)
Caused by: com.aspose.email.system.exceptions.IOException: Read failure
at com.aspose.email.internal.q.f.read(Unknown Source)
at com.aspose.email.ec.read(SourceFile:248)
at com.aspose.email.gv.b(SourceFile:168)
at com.aspose.email.gv.a(SourceFile:160)
at com.aspose.email.aug.r(SourceFile:317)
at com.aspose.email.aug.n(SourceFile:126)
at com.aspose.email.cq.a(SourceFile:324)
Caused by: com.aspose.email.system.exceptions.SocketException: An existing connection was forcibly closed by the remote host.
at com.aspose.email.internal.q.g.c(Unknown Source)
at com.aspose.email.internal.q.g.a(Unknown Source)
Please help me in this case