Appointment Exception while Trying to Load a Stream #2

Hello,

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

File icalFile = new File("sampleical2.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.FormatException: The specified string is not in the form required for an e-mail address.
com.aspose.email.MailAddress.g(SourceFile:867)
com.aspose.email.MailAddress.d(SourceFile:763)
com.aspose.email.MailAddress.<init>(SourceFile:139)
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.g(SourceFile:867)
	at com.aspose.email.MailAddress.d(SourceFile:763)
	at com.aspose.email.MailAddress.<init>(SourceFile:139)
	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 sampleical2.txt file.
sampleical2.zip (1.1 KB)

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

Thanks

@kelberuc1

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

@kelberuc1

You may be able to get around the email validation error by setting the IgnoreSmtpAddressCheck option on the AppointmentLoadOptions object and passing it in to the load call. Worked for me.

AppointmentLoadOptions alo = new AppointmentLoadOptions();
alo.setIgnoreSmtpAddressCheck(true);
appointment = Appointment.load(paths, alo);

@cpostlethwait,
Thank you for your help.

@kelberuc1,
I confirm you may use the code snippet above to get around the exception you described.

API Reference: AppointmentLoadOptions class