Not able to set Organizer property

Hello Team,

We are trying to set calender organizer property to aspose.eml using the below code snippet.

  Appointment  f_objAppointment 
  if (!String.IsNullOrEmpty(f_Organizer))
  f_objAppointment = new Appointment(f_Location, p_AppointmentObj.Subject, f_Body, f_StartDate,
                                                                   f_EndDate, new MailAddress(f_Organizer),
                                                                   f_objMailAddressColl);
  else

 f_objAppointment = new Appointment(f_Location, null, f_Body, f_StartDate,
                                                           f_EndDate, null,
                                                           f_objMailAddressColl);
  MailMessage f_objMsg = new MailMessage();
  f_objMsg.AddAlternateView(f_objAppointment.RequestApointment());
  f_objMapiMsg = MapiMessage.FromMailMessage(f_objMsg);                                                     
  MapiCalendar f_MapiCalendarObj = (MapiCalendar)f_objMapiMsg.ToMapiMessageItem();
  
MapiCalendarAttendees CalendarAttendees = null;

  if (!String.IsNullOrEmpty(p_AppointmentObj.Organizer))
     {
    
      CalendarAttendees.AppointmentRecipients.Add(p_AppointmentObj.Organizer, "test", MapiRecipientType.MAPI_ORIG);
        
      }
 if (!String.IsNullOrEmpty(p_AppointmentObj.OptionalAttendees))
     {

   f_SplitEntries  = p_Recipent.Split(f_SplitSeprator,StringSplitOptions.None);
   f_Count         = f_SplitEntries.Length;

   for (int Index = 0; Index < f_Count; Index++)
        {

       CalendarAttendees.AppointmentRecipients.Add(f_SplitEntries[Index], "test", MapiRecipientType.MAPI_CC);
                                   
         }
       }      
f_MapiCalendarObj.Attendees = CalendarAttendees;

Sender Email address and Organizer properties are getting assigned ( we can see that in outlook spy).
But if we are going in scheduling tab organizer is showing as unknown.

Please suggest on this.

Capture.PNG (51.1 KB)

Regards,

Shital

@Shital_diwate,

Thank you for writing to Aspose support team.

I have tried to re-produce this scenario using following sample code:

Appointment f_objAppointment;
string f_Organizer= "organizer@gmail.com";
string f_Location = null;
string Subject = "This is subject";
string f_Body = "This is body";
DateTime f_StartDate = DateTime.Now.AddHours(15);
DateTime f_EndDate = DateTime.Now.AddHours(16);
MailAddressCollection f_objMailAddressColl = new MailAddressCollection()
{
    new MailAddress("attendee1@gmail.com"),
    new MailAddress("attendee2@gmail.com"),
    new MailAddress("attendee3@gmail.com"),
};
if (!String.IsNullOrEmpty(f_Organizer))
    f_objAppointment = new Appointment(f_Location, Subject, f_Body, f_StartDate, f_EndDate, new MailAddress(f_Organizer), f_objMailAddressColl);
else
    f_objAppointment = new Appointment(f_Location, null, f_Body, f_StartDate, f_EndDate, null, f_objMailAddressColl);
MailMessage f_objMsg = new MailMessage();
f_objMsg.AddAlternateView(f_objAppointment.RequestApointment());
MapiMessage f_objMapiMsg = MapiMessage.FromMailMessage(f_objMsg);
MapiCalendar f_MapiCalendarObj = (MapiCalendar)f_objMapiMsg.ToMapiMessageItem();

MapiCalendarAttendees CalendarAttendees = new MapiCalendarAttendees();

if (!String.IsNullOrEmpty(f_Organizer))
{

    CalendarAttendees.AppointmentRecipients.Add(f_Organizer, "test", MapiRecipientType.MAPI_ORIG);

}
string OptionalAttendees = "attendee4@gmail.com;attendee5@gmail.com;attendee6@gmail.com";
char []f_SplitSeprator = { ';' };
if (!String.IsNullOrEmpty(OptionalAttendees))
{
    var f_SplitEntries = OptionalAttendees.Split(f_SplitSeprator, StringSplitOptions.None);
    var f_Count = f_SplitEntries.Length;

    for (int Index = 0; Index < f_Count; Index++)
    {
        CalendarAttendees.AppointmentRecipients.Add(f_SplitEntries[Index], "test", MapiRecipientType.MAPI_CC);
    }
}
f_MapiCalendarObj.Attendees = CalendarAttendees;
f_MapiCalendarObj.Save("output.ics", AppointmentSaveFormat.Ics);

This output.ics file is opened in Outlook and appointment is accepted. After this it can be observed that organizer is set properly as shown in the attached image. Could you please give a try to the above sample code and share the feedback?

SampleMeeting.png (14.8 KB)
output.zip (480 Bytes)

@kashif.iqbal

I tried with the code you have provided but still facing the same issue.
Can you please help me on this ?

I think the following code is the suspected one
string f_Organizer=“test@gmail.com”;
if (!String.IsNullOrEmpty(f_Organizer))
f_objAppointment = new Appointment(f_Location, p_AppointmentObj.Subject, f_Body, f_StartDate,
f_EndDate, new MailAddress(f_Organizer),
f_objMailAddressColl);
else

f_objAppointment = new Appointment(f_Location, null, f_Body, f_StartDate,
f_EndDate, null,
f_objMailAddressColl);

here new MailAddress(f_Organizer) this actually setting the organizer but in scheduling - Attendee list is showing that entry with UNKNOWN.
Entry is coming there for organizer but the value of email address is not coming there.
I suspect something property may be there which we need to set.

image.png (5.5 KB)

Like in the MapiRecipient we have option like addresType , but we are not getting alternative to this in mailaddress , does it affect ?
We have check with both the versions 18.2 and with 18.3.

@Shital_diwate,

We have again tested this at our end and can not reproduce any such issue at our end which shows that its not affected by addressType. Can you create a simple console application that generates the required output and list the steps to observe the problem in MS Outlook? This will help us investigate the issue in detail and assist you further.

Sure.
Please see the test application given. It also reproduces the issue.
This test application will create PST with one appointment in it.

Environment :
Outlook 2007 where we are checking the created PST
machine is 32 bit windows 7

Steps:
Please run the given test application .
It will create one PST file named as “c:\temp\test1.pst”
Now open this PST in outlook.
There you will get calendar in the folder named as test_calendar
image.png (13.7 KB)

Now open this calendar and see the first look
Here it is showing Organizer as what we have set.

image.png (48.3 KB)
Now do double click on it and the window comes up will also give you the proper details

image.png (22.4 KB)

Now close this and go on the scheduling.

image.png (43.5 KB)

Now here is the problem. See the entries it is showing.

See we have added 3 attendees as required ,optional and the resource and one organizer in total 4. (Please refer the code)
Organizer -> organizer@gmail.com
attendee1@gmail.com-> To\Required
attendee2@gmail.com->Cc\optional
attendee3@gmail.com->Bcc\Resource

Here it is showing 5 entries
One extra entry as UNKNOWN (Organizer is getting set as required.)

One more thing we observe on the Outlook which is configured with one account (2016)
It is showing default profile as a Organizer for same PST.

Please see the test application here.

PST_ASPOSE_TEST_APPLICATION.zip (2.6 MB)

@Shital_diwate,

Thank you for providing sample files.

This issue is re-produced and logged under Id:EMAILNET-38947 for further investigation. We will write back here as soon as analysis is done and feedback is ready to share.

Thank you for the information.
Can you please provide the ETA so that accordingly we can schedule our release.

@Shital_diwate,

Thank you for writing to Aspose support team again.

This issue is logged too recently and is still in queue for analysis. Once we analyze the scenario on its turn and issue is identified, we will provide our feedback here.

Any update here ?

@Shital_diwate,

The issue is pending for investigation and no further information is available in this regard. We’ll update you here once there is some information available in this regard.

Any update here.
Waiting for the solution.

@Shital_diwate,

We have further investigated this at our end and found that this is not a bug of Aspose.Email API. Outlook shows the owner of Outlook (email account) as an additional attendee when we open a meeting in PST. If the computer does not have an email account, it appears as an Unknown attendee.

We can’t say that its outlook behavior.
When am opening one user calendar file in another outlook configured with different user account outlook shows the original organizer, not the current user account configured.

Please investigate more on this and let me know the status.

@Shital_diwate,

We are working on this issue and request you to spare us little time to complete the analysis and share the feedback.

Sure.I can understand your point.

I think we already spend more than 2 weeks on same issue.It is very difficult for me to make it understand to my Manager. He already has doubt for Aspose accuracy but I am trying to tell him at my best , because of few issues which I believe you can solve I do not want him to rethink on Aspose.
Please consider all above parameters.We doesn’t have much time.Sooner is better.
I think our main concern is the regression or say the changes in existing method prototype or in the existing properties, because of this even you are giving DLL we need to spend time in testing.

@Shital_diwate,

We have analyzed the issue again and observed the behavior as mentioned above by you. We have re-opened the ticket for further analysis and will write back here soon once feedback is ready.

We are sorry for the inconvenience caused to you in this regard.

Any update here ?

@Shital_diwate,

Work is in progress on this issue, however time line cannot be provided yet. We will write back here once feedback is ready to share.

Any update on this?
It’s been one month we are waiting for the solution…