Here is in which you can send appointments via ICalendar format through code and not using the Outlook Object library (This is a very basic version of the way and does not involve much exception handling,and doesnt take care of nth case , explore a bit on that front :))

I am going to show the method of sending an appointment by creating a ICalendar Appointment file first and then sending it as an attachement over email. (The way in which ICalendar format files are sent when you click on Tools ->Export -> as ICalendar file in the appointment )

Here is the declaration for the TimeFormat and some variables used to fill the Appoinment details. viz start time,endtime etc.

Create a Skeleton for the appointment ICalendar file format and using the variables created above we will assign the values accordingly into the Appoinment skeleton. (This string concatation can be optimised by using string builder)

Now that we have the ICalendar file created, we need to write it to the disk so as to attach it to the outgoing email
(Anybody knows a method of just creating the ICalendar file in memory and directly attaching the file without creating a Physical file please leave a feedback on how to do that,didnt get much time to look into it.)

I create on meeting request application, which create meeting request as per user input.
but when I send out the email its not shows the required and optional field in my client server, but it show fine in my local server.

Hi Team, I wanted to send event confirmation to user in form of outllok appointmnt and my code is in ASP.Classic, windows server 2000 and outlook is not installed.
when i execute below code my webpage hangs up..

Is there any option in vcalander so that organizer’s calander will also blocked for a particular meeting request.Right now all your code is sending a meeting request to another party where in if he accepts organizer will get a resonse.Is there any way that organizer’s calander also auto booked once a mail is send using your code.Pls help me out…Thanks in advance

I found one place to make an (optional) enhancement and figured I would share.

Instead of actually writing out a file to disk, you can create the attachment directly from the vCalendarFile string. The System.Net.Mail.Attachment class has a static method called CreateAttachmentFromString(). So instead of:

Do you know if it’s possible to send the appointment/meeting request in a way that it appears directly in Outlook calendar as accepted, without the user having to open the attachment and accept it?
I guess sending the ics file as attachment wouldn’t work for this problem…

Please help me, Same requirement for me also.
My requirement appointment/meeting request, it appears directly in Outlook calendar as accepted, without the user having to open the attachment and accept it,
Please guide me

Its urgent
Advance Thanks

Jenkins

May 13, 2009 at 9:45 am
Hi,

Do you know if it’s possible to send the appointment/meeting request in a way that it appears directly in Outlook calendar as accepted, without the user having to open the attachment and accept it?
I guess sending the ics file as attachment wouldn’t work for this problem…

For your requirement instead of using the .ics file approach you will have to create and utilise Microsoft Outlook object library objects.This will provide you the functionality that you require.

Cons:

1) Outlook needs to be installed on the server
2) After Service PAck2 the security features have been increased requiring manual intervention of granting access to the code to utilise the outlook objects.

I am not sure what you mean by free time? if by free time you meaning keeping the meeting open?

See basically the code above is a tweak for generating the ics file thru code using a template… we can play around with the values inside the template to change the meeting the way we want.. try tweaking the values of time etc…

or else do it through outlook first then save that meeting as an .ICS file and open in notepad to check the contents and use them in your code…

Thanks a lot for the amazing post Shaunak!!
It really worked well. However, I have a little problem.
When I send a meeting request, I want to “Show time as :Free”.
Any ideas on this? Thanks in advance.

1) First check if you are able to save chinese data into a file outside the appointment component using file operations.If this is happening then it means you need to check on the way we are creating the appointment file.

2) If the file using file operations cannot save Chinese data then you will have to find out the way to get that done and implement the changes in the apointment component here.

I am sending the ICS file in the mail, but the problem that I have is that the application is working in EST time zone. So, if a user who is in CST or Mountain time takes an appointment for EST timings shown on the screen, the ics file in the mail should convert the time to the desired time zone in the mail. Is this possible?

Although the above works in creating an outlook calendar event, It does not work for me when I am trying to write chinese characters ‘日期’ into the body. I have tried setting the stream writers encoding to utf-8; but failing on all attempts. Is there anything wrong that i am doing.

1) First check if you are able to save chinese data into a file outside the appointment component using file operations.If this is happening then it means you need to check on the way we are creating the appointment file.

2) If the file using file operations cannot save Chinese data then you will have to find out the way to get that done and implement the changes in the apointment component here.

Okay, one baby-step at a time. Got both working,
Shounak: Thats great news finally sucess!! 🙂

but no matter what, when I receive the email and double-click the ics file, another folder is set up.
Shounak: another folder is setup? dint understand this? ideally it should send you a mail with the ics file as an attachment.

I set up a rule in Groupwise so that any appointment with the subject line is automatically added to another calendar folder. So, at least I could have them all in one? Do you know of any way to:

Pros to this approach
1) Uses the default users outlook account
2) Sends mail through the outlook , mail is kept in the sent items

Cons to this approach
1) Microsoft outlook is necessary (as per my last research i had done 3-4 years back not sure even if we require it now)
2)Microsoft security update patches have disabled the usage of outlook library through code unless the user manually clicks on a prompt stating that some thrid party is trying to access outlook should it be granted access

2) How to make the ics file a part of the main parent calendar folder.
Shounak: I am not sure how groupwise functions but in MS outlook the ics file opens into a calendar in the main calendar only. Do you have 2 calendars setup on your system? it might be going in the default one.

3) A good resource for all of the parameters, etc. you’ve given.
Shounak: dint understand wht you meant here? do you require some reference for the code? or mail class?

You’ve been lovely with all of your replies – thanks again.
Shounak: Thanks a tonne for the appreciations feel good to know my lil help is appreciated!! 🙂

Okay, one baby-step at a time. Got both working, but no matter what, when I receive the email and double-click the ics file, another folder is set up. I set up a rule in Groupwise so that any appointment with the subject line is automatically added to another calendar folder. So, at least I could have them all in one? Do you know of any way to: 1) Not have to click on the ics file as an attachment but have the appointment come directly into GroupWise, e.g. no email as a wrapper? 2) How to make the ics file a part of the main parent calendar folder. 3) A good resource for all of the parameters, etc. you’ve given. You’ve been lovely with all of your replies – thanks again.

When I click on the 2.ics attachment file, another calendar (versus simply an appointment) is added to my calendar list. No error. No appointment. I know I’ve probably got something wrong or missing – I’m just so new, I’m not sure where to go. …JB

Brand new at this and trying to convert and use your code in vb to send .net (I’m using .net 2) appointment to Groupwise (Novell says it accepts iCal and iMip services). Tried a version, got the email, but when I clicked on the attachment, nothing appeared as an appointment. When I click “To see the code for the above SendAppoinment method click here”, I get a page not found. Any way you could forward?

Hmm thats interesting point you have it there.. why dont you send a meeting request through the code in the abolve fashion and cancel the request through outlook and try and save the ics file or the cancelation request into an ics file and open it and view the file to get the skeleton..

I’m already sending meeting requests as an .ics attachement like you described. Do you know of any way to send another .ics with the same UID that will cancel or delete a previously accecpted meeting request from a users calendar?