Asp.NET Meeting Request C# ,

Namespace: System.Net.Mail
'iCalendar' is a format which allows users to send meeting requests and tasks to other users, via email, or sharing files with an extension of .ics. iCalendar is based on a the earlier 'vCalendar' format (files with an extension of .vcs) and Outlook 2007 handles both formats well.
Both .vcs (vCal) and .ics (iCal) belongs to the same VCALENDAR camp, but .vcs file shows "VERSION:1.0" whereas .ics file uses "VERSION:2.0".
Format:
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//hacksw/handcal//NONSGML v1.0//EN
BEGIN:VEVENT
UID:uid1@example.com
DTSTAMP:19970714T170000Z
ORGANIZER;CN=John Doe:MAILTO:john.doe@example.com
DTSTART:19970714T170000Z
DTEND:19970715T035959Z
SUMMARY:Bastille Day Party
END:VEVENT
END:VCALENDAR
The following example uses SMTP client to send an email.


The following example uses SMTP client to send an email.
SmtpClient sc = new SmtpClient("yoursmtpServer.com");
                MailMessage msg = new MailMessage();

                msg.From = new MailAddress("message.from@site.com", "SUPPORT TEAM");
                msg.To.Add(new MailAddress(email, Disaplay_name));
                msg.Subject = "Send Notification";
                msg.Body = "Welcome to the Event. You have been scheduled for Training";

                StringBuilder str = new StringBuilder();
                str.AppendLine("BEGIN:VCALENDAR");

                //PRODID: identifier for the product that created the Calendar object
                str.AppendLine("PRODID:-//ABC Company//Outlook MIMEDIR//EN");
                str.AppendLine("VERSION:2.0");
                **str.AppendLine("METHOD:REQUEST");**

                str.AppendLine("BEGIN:VEVENT");

                str.AppendLine(string.Format("DTSTART:{0:yyyyMMddTHHmmssZ}", TimeZoneInfo.ConvertTimeToUtc("BeginTime").ToString("yyyyMMddTHHmmssZ")));
                str.AppendLine(string.Format("DTSTAMP:{0:yyyyMMddTHHmmssZ}", DateTime.UtcNow));
                str.AppendLine(string.Format("DTEND:{0:yyyyMMddTHHmmssZ}", TimeZoneInfo.ConvertTimeToUtc("EndTime").ToString("yyyyMMddTHHmmssZ")));
                str.AppendLine(string.Format("LOCATION: {0}", "Location"));

                // UID should be unique.
                str.AppendLine(string.Format("UID:{0}", Guid.NewGuid()));
                str.AppendLine(string.Format("DESCRIPTION:{0}", msg.Body));
                str.AppendLine(string.Format("X-ALT-DESC;FMTTYPE=text/html:{0}", msg.Body));
                str.AppendLine(string.Format("SUMMARY:{0}", msg.Subject));

                str.AppendLine("STATUS:CONFIRMED");
                str.AppendLine("BEGIN:VALARM");
                str.AppendLine("TRIGGER:-PT15M");
                str.AppendLine("ACTION:DISPLAY");
                str.AppendLine("DESCRIPTION:Reminder");
                str.AppendLine("END:VALARM");
                str.AppendLine("END:VEVENT");


                str.AppendLine(string.Format("ORGANIZER:MAILTO:{0}", msg.From.Address));
                str.AppendLine(string.Format("ATTENDEE;CN=\"{0}\";RSVP=TRUE:mailto:{1}", msg.To[0].DisplayName, msg.To[0].Address));

                str.AppendLine("END:VCALENDAR");
                System.Net.Mime.ContentType ct = new System.Net.Mime.ContentType("text/calendar");
                ct.Parameters.Add("method", "REQUEST");
                ct.Parameters.Add("name", "meeting.ics");
                AlternateView avCal = AlternateView.CreateAlternateViewFromString(str.ToString(), ct);
                msg.AlternateViews.Add(avCal);

                sc.ServicePoint.MaxIdleTime = 2;
                sc.Send(msg);
To delete the same calender request, you need to change the below attributes
  • Method:Cancel str.AppendLine("METHOD:CANCEL");
  • UID should be same which you provided while creating appointment.
  • Sequence should be same.
  • Status should be changed from Confirmed To cancelled.str.AppendLine("STATUS:CANCELLED");
  • ct.Parameters.Add("method", "CANCEL");
These are some of the links I used for reference.

Post a Comment

1 Comments

  1. Asp.Net Meeting Request C , >>>>> Download Now

    >>>>> Download Full

    Asp.Net Meeting Request C , >>>>> Download LINK

    >>>>> Download Now

    Asp.Net Meeting Request C , >>>>> Download Full

    >>>>> Download LINK TC

    ReplyDelete
Emoji
(y)
:)
:(
hihi
:-)
:D
=D
:-d
;(
;-(
@-)
:P
:o
:>)
(o)
:p
(p)
:-s
(m)
8-)
:-t
:-b
b-(
:-#
=p~
x-)
(k)

Close Menu