{"id":1614,"date":"2010-11-19T18:57:16","date_gmt":"2010-11-19T16:57:16","guid":{"rendered":"http:\/\/www.limilabs.com\/blog\/?p=1614"},"modified":"2016-09-09T10:36:24","modified_gmt":"2016-09-09T08:36:24","slug":"send-icalendar-recurring-meeting-requests","status":"publish","type":"post","link":"https:\/\/www.limilabs.com\/blog\/send-icalendar-recurring-meeting-requests","title":{"rendered":"Send iCalendar recurring meeting requests"},"content":{"rendered":"<p>First add all necessary namespaces:<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\n\/\/ C# version\r\n\r\nusing System;\r\nusing Limilabs.Mail;\r\nusing Limilabs.Mail.Appointments;\r\nusing Limilabs.Mail.Headers;\r\nusing Fluent = Limilabs.Mail.Fluent;\r\nusing Limilabs.Client.SMTP;\r\n<\/pre>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n' VB.NET version\r\n\r\nImports System;\r\nImports Limilabs.Mail;\r\nImports Limilabs.Mail.Appointments;\r\nImports Limilabs.Mail.Headers;\r\nImports Fluent = Limilabs.Mail.Fluent;\r\nImports Limilabs.Client.SMTP;\r\n<\/pre>\n<p>Now, we&#8217;ll create an appointment, specify it&#8217;s recurring options and send it:<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\n\/\/ C# version\r\n\r\nAppointment appointment = new Appointment();\r\nEvent newEvent = appointment.AddEvent();\r\nnewEvent.SetOrganizer(new Person(&quot;Alice&quot;, &quot;alice@example.org&quot;));\r\nnewEvent.AddParticipant(new Participant(&quot;Bob&quot;, &quot;bob@gmail.com&quot;));\r\nnewEvent.Description = &quot;We need to talk about the daily report&quot;;\r\nnewEvent.Summary = &quot;Daily report meeting&quot;;\r\nnewEvent.Start = new DateTime(2010, 11, 29, 16, 0, 0);\r\nnewEvent.End = new DateTime(2010, 11, 29, 17, 0, 0);\r\nnewEvent.Priority = 5;\r\nnewEvent.Class = EventClass.Public;\r\n\r\nRecurringRule rule = newEvent.AddRecurringRule();\r\nrule.Interval = 1;\r\nrule.Until = new DateTime(2011, 12, 1); \/\/ -or- rule.Count = 10;\r\n\r\n\/\/ Every week on  Mon, Tue, Wed, Thu Fri:\r\nrule.Frequency = Frequency.Weekly;\r\nrule.ByDay.AddRange(new&#x5B;] {\r\n    Weekday.Monday,\r\n    Weekday.Tuesday,\r\n    Weekday.Wednesday,\r\n    Weekday.Thursday,\r\n    Weekday.Friday });\r\n\r\nAlarm alarm = newEvent.AddAlarm();\r\nalarm.Description = &quot;Reminder&quot;;\r\nalarm.BeforeStart(TimeSpan.FromMinutes(5));\r\n\r\nIMail email = Fluent.Mail.Text(&quot;Daily report meeting at 4PM&quot;)\r\n    .Subject(&quot;Daily report meeting&quot;)\r\n    .From(new MailBox(&quot;alice@example.org&quot;, &quot;Alice&quot;))\r\n    .To(new MailBox(&quot;bob@example.org&quot;, &quot;Bob&quot;))\r\n    .AddAppointment(appointment)\r\n    .Create();\r\n\r\nusing (Smtp client = new Smtp())\r\n{\r\n    client.ConnectSSL(&quot;smtp.example.org&quot;);\r\n    client.UseBestLogin(&quot;user&quot;, &quot;password&quot;);\r\n    client.SendMessage(email);\r\n    client.Close();\r\n}\r\n<\/pre>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n' VB.NET version\r\n\r\nDim appointment As New Appointment()\r\nDim newEvent As &#x5B;Event] = appointment.AddEvent()\r\nnewEvent.SetOrganizer(New Person(&quot;Alice&quot;, &quot;alice@example.org&quot;))\r\nnewEvent.AddParticipant(New Participant(&quot;Bob&quot;, &quot;bob@gmail.com&quot;))\r\nnewEvent.Description = &quot;We need to talk about the daily report&quot;\r\nnewEvent.Summary = &quot;Daily report meeting&quot;\r\nnewEvent.Start = New DateTime(2010, 11, 29, 16, 0, 0)\r\nnewEvent.&#x5B;End] = New DateTime(2010, 11, 29, 17, 0, 0)\r\nnewEvent.Priority = 5\r\nnewEvent.&#x5B;Class] = EventClass.&#x5B;Public]\r\n\r\nDim rule As RecurringRule = newEvent.AddRecurringRule()\r\nrule.Interval = 1\r\nrule.Until = New DateTime(2011, 12, 1)\r\n' -or- rule.Count = 10;\r\n' Every week on  Mon, Tue, Wed, Thu Fri:\r\nrule.Frequency = Frequency.Weekly\r\nrule.ByDay.AddRange(New Weekday() {Weekday.Monday _\r\n                                   , Weekday.Tuesday _\r\n                                   , Weekday.Wednesday _\r\n                                   , Weekday.Thursday _\r\n                                   , Weekday.Friday})\r\n\r\nDim alarm As Alarm = newEvent.AddAlarm()\r\nalarm.Description = &quot;Reminder&quot;\r\nalarm.BeforeStart(TimeSpan.FromMinutes(5))\r\n\r\nDim email As IMail = Fluent.Mail.Text(&quot;Daily report meeting at 4PM&quot;) _\r\n    .Subject(&quot;Daily report meeting&quot;) _\r\n    .From(New MailBox(&quot;alice@example.org&quot;, &quot;Alice&quot;)) _\r\n    .&#x5B;To](New MailBox(&quot;bob@example.org&quot;, &quot;Bob&quot;)) _\r\n    .AddAppointment(appointment).Create()\r\n\r\nUsing client As New Smtp()\r\n    client.ConnectSSL(&quot;smtp.example.org&quot;)\r\n    client.UseBestLogin(&quot;user&quot;, &quot;password&quot;)\r\n    client.SendMessage(email)\r\n    client.Close()\r\nEnd Using\r\n\r\n<\/pre>\n<p>This is how it looks like in Gmail:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/blog\/wp-content\/uploads\/2010\/11\/RecurringAppointment1.jpg\" alt=\"Recurring appointment\" title=\"Recurring appointment\" width=\"600\" height=\"370\" class=\"aligncenter size-full\" \/><\/p>\n<h2> Recurring meeting frequency<\/h2>\n<p>Here are the few samples of how you can set the frequency:<\/p>\n<p>Daily:<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\n\/\/ C# version\r\n\r\nrule.Frequency = Frequency.Daily;\r\n<\/pre>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n' VB.NET version\r\n\r\nrule.Frequency = Frequency.Daily\r\n<\/pre>\n<p>Every month on last monday:<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\n\/\/ C# version\r\n\r\nrule.Frequency = Frequency.Monthly;\r\nrule.ByDay.Add(Weekday.LastMonday);\r\n<\/pre>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n' VB.NET version\r\n\r\nrule.Frequency = Frequency.Monthly\r\nrule.ByDay.Add(Weekday.LastMonday)\r\n<\/pre>\n<p>Every month on second but last monday:<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\n\/\/ C# version\r\n\r\nrule.Frequency = Frequency.Monthly;\r\nrule.ByDay.Add(new Weekday(-2, Weekday.Monday));\r\n<\/pre>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n' VB.NET version\r\n\r\nrule.Frequency = Frequency.Monthly\r\nrule.ByDay.Add(New Weekday(-2, Weekday.Monday))\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>First add all necessary namespaces: \/\/ C# version using System; using Limilabs.Mail; using Limilabs.Mail.Appointments; using Limilabs.Mail.Headers; using Fluent = Limilabs.Mail.Fluent; using Limilabs.Client.SMTP; &#8216; VB.NET version Imports System; Imports Limilabs.Mail; Imports Limilabs.Mail.Appointments; Imports Limilabs.Mail.Headers; Imports Fluent = Limilabs.Mail.Fluent; Imports Limilabs.Client.SMTP; Now, we&#8217;ll create an appointment, specify it&#8217;s recurring options and send it: \/\/ C# version Appointment [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[15,33,26,50,57],"class_list":["post-1614","post","type-post","status-publish","format-standard","hentry","category-mail-dll","tag-c","tag-email-component","tag-icalendar","tag-smtp","tag-vb-net"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/1614"}],"collection":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/comments?post=1614"}],"version-history":[{"count":6,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/1614\/revisions"}],"predecessor-version":[{"id":5069,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/1614\/revisions\/5069"}],"wp:attachment":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/media?parent=1614"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/categories?post=1614"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/tags?post=1614"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}