ArgumentException Is Occurring while Trying to Load a Stream

Hello,

I’m trying to load a vCalendar file into an Appointment object using the following code:

File icalFile = new File("sampleical.txt");
InputStream stream = new FileInputStream(icalFile);
    	
Appointment appointment = Appointment.load(stream);  // <-- line which gets the error

I’m facing the following exception:

Exception in thread "main" class com.aspose.email.system.exceptions.ArgumentException: The parameter 'address' cannot be an empty string.
Parameter name: address
com.aspose.email.MailAddress.<init>(SourceFile:133)
com.aspose.email.MailAddress.<init>(SourceFile:211)
com.aspose.email.zgy.a(SourceFile:787)
com.aspose.email.zgy.e(SourceFile:490)
com.aspose.email.zgy.b(SourceFile:232)
com.aspose.email.Appointment.a(SourceFile:1420)
com.aspose.email.Appointment.b(SourceFile:1362)
com.aspose.email.Appointment.load(SourceFile:1355)
TestProject.main(TestProject.java:40)
	at com.aspose.email.MailAddress.<init>(SourceFile:133)
	at com.aspose.email.MailAddress.<init>(SourceFile:211)
	at com.aspose.email.zgy.a(SourceFile:787)
	at com.aspose.email.zgy.e(SourceFile:490)
	at com.aspose.email.zgy.b(SourceFile:232)
	at com.aspose.email.Appointment.a(SourceFile:1420)
	at com.aspose.email.Appointment.b(SourceFile:1362)
	at com.aspose.email.Appointment.load(SourceFile:1355)
	at TestProject.main(TestProject.java:40)

Please find attached the sampleical.txt file.
sampleical.zip (1.3 KB)

As soon as possible, let me know how I can solve this issue.

Thanks

@kelberuc1

I have created an issue with ID EMAILJAVA-34914 in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

@kelberuc1,
Our development team investigated the issue. You can use the AppointmentLoadOptions class to ignore Address validation as shown below:

File icalFile = new File("sampleical.txt");
InputStream stream = new FileInputStream(icalFile);

AppointmentLoadOptions lo = new AppointmentLoadOptions();
lo.setIgnoreSmtpAddressCheck(true);
Appointment appointment = Appointment.load(stream, lo);

API Reference: AppointmentLoadOptions class