GraphClinet listMessage Exception

Hi

I am using Aspose email version 21.10 on Windows. Wih one specific msg file method IGraphClient.listMessages throws an exception:
class com.aspose.email.system.exceptions.FormatException: The specified string is not in the form required for an e-mail address.
com.aspose.email.MailAddress.g(SourceFile:885)

com.aspose.email.MailAddress.a(SourceFile:837)

com.aspose.email.MailAddress.(SourceFile:134)

com.aspose.email.MailAddress.(SourceFile:79)

com.aspose.email.GraphMessageInfo.a(SourceFile:380)

com.aspose.email.GraphMessageInfo.a(SourceFile:34)

com.aspose.email.GraphMessageInfoCollection.a(SourceFile:32)

com.aspose.email.zyy.a(SourceFile:89)

com.aspose.email.zyc.a(SourceFile:50)

com.aspose.email.zyd.n(SourceFile:64)

com.aspose.email.zye.listMessages(SourceFile:175)

com.jcds.omni.emails.triage.aspose.AsposeGraphEmailClient.HandleEmailsAspose(AsposeGraphEmailClient.java:668)

com.jcds.omni.emails.triage.auto_ingestion.IngestTriageEmails.execute(IngestTriageEmails.java:638)

com.jcds.omni.emails.triage.auto_ingestion.IngestTriageEmails.main(IngestTriageEmails.java:1101)

at com.aspose.email.MailAddress.g(SourceFile:885)

at com.aspose.email.MailAddress.a(SourceFile:837)

at com.aspose.email.MailAddress.(SourceFile:134)

at com.aspose.email.MailAddress.(SourceFile:79)

at com.aspose.email.GraphMessageInfo.a(SourceFile:380)

at com.aspose.email.GraphMessageInfo.a(SourceFile:34)

at com.aspose.email.GraphMessageInfoCollection.a(SourceFile:32)

at com.aspose.email.zyy.a(SourceFile:89)

at com.aspose.email.zyc.a(SourceFile:50)

at com.aspose.email.zyd.n(SourceFile:64)

at com.aspose.email.zye.listMessages(SourceFile:175)

at com.jcds.omni.emails.triage.aspose.AsposeGraphEmailClient.HandleEmailsAspose(AsposeGraphEmailClient.java:668)

at com.jcds.omni.emails.triage.auto_ingestion.IngestTriageEmails.execute(IngestTriageEmails.java:638)

at com.jcds.omni.emails.triage.auto_ingestion.IngestTriageEmails.main(IngestTriageEmails.java:1101)

Any fixe? How can I know which email adress is wrong?
Regards

Hello,

Could you please try reproducing the issue with the latest version of Aspose.Email and check if the problem still occurs?

Thank you.

Hi

I tested with version 26.1 and issue is solved. I disabled licence setting to be able to test. I got the following error about licence:
Failed to set license. Details: Invalid character in the given encoding. Line 21, position 11.

Do I need to upgrade my licence or there is another issue?

Regards

@elie.kach,

One thing we’d like to clarify: you mentioned that you disabled the license setting, but you’re still getting the error: “Failed to set license…”

If the license setting is fully disabled, the system shouldn’t attempt to load or validate a license.

Could you please confirm:

How exactly was the license setting disabled?

Thank you.

Hi

When I run Java code with Aspose email 21.6 version, I got the error message about the licence which does not appear using previous version. This is a new error

So I disabled Java setting licence in order to perform my test which is OK and solve issue about email address no correct:
class com.aspose.email.system.exceptions.FormatException: The specified string is not in the form required for an e-mail address

My question: Version 26.1 fixes the issue but to be able to use this version and avoid licence error, do I need upgrade my licence??

@elie.kach,

Yes, you need to renew the license.

Hi,

Before purchasing a new licence, I got a temporary licence for testing and still having the following error:
class com.aspose.email.system.exceptions.InvalidOperationException: Failed to set license. Details: Invalid character in the given encoding. Line 23, position 11.
com.aspose.email.License.a(SourceFile:354)
com.aspose.email.License.setLicense(SourceFile:305)

Is it a licence issue or something else?

My code to set licence (Aspose.EmailforJava.lic is the temporary licence I got this today):
com.aspose.email.License license = new com.aspose.email.License();
try {
license.setLicense(new java.io.FileInputStream(m_licencePath + File.separator + “Aspose.EmailforJava.lic”));
} catch (FileNotFoundException e1) {
e1.printStackTrace();
return false;
}

@elie.kach,

Thank you for the details.
We’ll try to reproduce this issue on our side.
We’ll get back to you as soon as we have an update.

Hello @elie.kach ,

We have prepared a test build to further investigate the licensing issue you are experiencing.

Please try it with your current temporary license and share the updated stack trace. This will help us identify whether the issue is related to license parsing or another factor.

Additionally, please confirm that:

  • The license file has not been modified after download
  • The file encoding remains unchanged (no re-saving in editors that may alter encoding)

Looking forward to your feedback.

@elie.kach
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): EMAILJAVA-35451

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@elie.kach ,

The issue has been resolved.

The fix will be included in the upcoming Aspose.Email for Java 26.3 release, scheduled for April 6–7.

As a workaround, you can use the setLicense method without FileInputStream, which should work without issues:

license.setLicense(m_licencePath + File.separator + "Aspose.EmailforJava.lic");

Thank you for your patience.

Thank you!!
Regards

You are welcome!