{"id":886,"date":"2010-05-10T20:00:42","date_gmt":"2010-05-10T18:00:42","guid":{"rendered":"http:\/\/www.limilabs.com\/blog\/?p=886"},"modified":"2019-04-09T13:54:07","modified_gmt":"2019-04-09T11:54:07","slug":"send-icalendar-meeting-requests","status":"publish","type":"post","link":"https:\/\/www.limilabs.com\/blog\/send-icalendar-meeting-requests","title":{"rendered":"Send iCalendar meeting requests"},"content":{"rendered":"<p><a href=\"\/mail\">Mail.dll .NET email component<\/a> includes support for popular iCalendar standard.<\/p>\n<p><strong>iCalendar<\/strong> is used by most popular email clients like Outlook or Gmail. It allows Internet users to send meeting requests and tasks to other users, via email, or sharing files with an extension of .ics.<\/p>\n<p>Recipients of the iCalendar data file (with supporting software, such as an email client or calendar application) can respond to the sender easily or counter propose another meeting date\/time.<\/p>\n<p>First make sure that your &#8216;usings&#8217; or &#8216;Imports&#8217; section includes all needed namespaces:<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\n\/\/ C#\r\n\r\nusing Limilabs.Mail;\r\nusing Limilabs.Mail.Fluent;\r\nusing Limilabs.Mail.Appointments;\r\n<\/pre>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n' VB.NET\r\n\r\nImports Limilabs.Mail\r\nImports Limilabs.Mail.Fluent\r\nImports Limilabs.Mail.Appointments\r\n<\/pre>\n<p>And now the code.<\/p>\n<p>First we&#8217;ll create an appointment object add new event to it:<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nAppointment appointment = new Appointment();\r\nEvent e = appointment.AddEvent();\r\n<\/pre>\n<p>Then we need to set <strong>start <\/strong>and <strong>end dates<\/strong>:<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\ne.Description = &quot;Status meeting description&quot;;\r\ne.Summary = &quot;Status meeting summary&quot;;\r\ne.Start = new DateTime(2015, 05, 10, 16, 00, 00);\r\ne.End = new DateTime(2015, 05, 10, 17, 00, 00);\r\n<\/pre>\n<p>Now we&#8217;ll add all required and optional <strong>participants <\/strong> to it:<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\ne.SetOrganizer(new Person(&quot;Alice&quot;, &quot;alice@mail.com&quot;));\r\n\r\ne.AddParticipant(new Participant(\r\n\t&quot;Bob&quot;, &quot;bob@mail.com&quot;, ParticipationRole.Required, true));\r\ne.AddParticipant(new Participant(\r\n\t&quot;Tom&quot;, &quot;tom@mail.com&quot;, ParticipationRole.Optional, true));\r\ne.AddParticipant(new Participant(\r\n\t&quot;Alice&quot;, &quot;alice@mail.com&quot;, ParticipationRole.Required, true));\r\n<\/pre>\n<p>We&#8217;ll add an <strong>alarm <\/strong>to the event (set 15 minutes before the event start):<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nAlarm alarm = e.AddAlarm();\r\nalarm.BeforeStart(TimeSpan.FromMinutes(15));\r\n<\/pre>\n<p>Finally we&#8217;ll create an email <strong>add the appointment<\/strong> to it and send it:<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nMail.Text(&quot;Status meeting at 4PM.&quot;)\r\n\t.Subject(&quot;Status meeting&quot;)\r\n\t.From(&quot;alice@mail.com&quot;)\r\n    .To(&quot;bob@mail.com&quot;)\r\n    .AddAppointment(appointment)\r\n    .UsingNewSmtp()\r\n    .WithCredentials(&quot;alice@mail.com&quot;, &quot;password&quot;)\r\n\t.Server(&quot;smtp.mail.com&quot;)\r\n\t.WithSSL()\r\n\t.Send();\r\n<\/pre>\n<p>The <strong>entire C# code<\/strong> looks as follows:<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nAppointment appointment = new Appointment();\r\n\r\nEvent e = appointment.AddEvent();\r\ne.Description = &quot;Status meeting description&quot;;\r\ne.Summary = &quot;Status meeting summary&quot;;\r\ne.Start = new DateTime(2015, 05, 10, 16, 00, 00);\r\ne.End = new DateTime(2015, 05, 10, 17, 00, 00);\r\n\r\ne.SetOrganizer(new Person(&quot;Alice&quot;, &quot;alice@mail.com&quot;));\r\n\r\ne.AddParticipant(new Participant(\r\n\t&quot;Bob&quot;, &quot;bob@mail.com&quot;, ParticipationRole.Required, true));\r\ne.AddParticipant(new Participant(\r\n\t&quot;Tom&quot;, &quot;tom@mail.com&quot;, ParticipationRole.Optional, true));\r\ne.AddParticipant(new Participant(\r\n\t&quot;Alice&quot;, &quot;alice@mail.com&quot;, ParticipationRole.Required, true));\r\n\r\nAlarm alarm = e.AddAlarm();\r\nalarm.BeforeStart(TimeSpan.FromMinutes(15));\r\n\r\nMail.Text(&quot;Status meeting at 4PM.&quot;)\r\n\t.Subject(&quot;Status meeting&quot;)\r\n\t.From(&quot;alice@mail.com&quot;)\r\n    .To(&quot;bob@mail.com&quot;)\r\n    .AddAppointment(appointment)\r\n    .UsingNewSmtp()\r\n    .WithCredentials(&quot;alice@mail.com&quot;, &quot;password&quot;)\r\n\t.Server(&quot;smtp.mail.com&quot;)\r\n\t.WithSSL()\r\n\t.Send();\r\n<\/pre>\n<p>&#8230;and the VB.NET version:<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\nDim appointment As New Appointment()\r\n\r\nDim e As &#x5B;Event] = appointment.AddEvent()\r\ne.Description = &quot;Status meeting description&quot;\r\ne.Summary = &quot;Status meeting summary&quot;\r\ne.Start = New DateTime(2015, 5, 10, 16, 0, 0)\r\ne.&#x5B;End] = New DateTime(2015, 5, 10, 17, 0, 0)\r\n\r\ne.SetOrganizer(New Person(&quot;Alice&quot;, &quot;alice@mail.com&quot;))\r\n\r\ne.AddParticipant(New Participant( _\r\n\t&quot;Bob&quot;, &quot;bob@mail.com&quot;, ParticipationRole.Required, True))\r\ne.AddParticipant(New Participant( _\r\n\t&quot;Tom&quot;, &quot;tom@mail.com&quot;, ParticipationRole.&#x5B;Optional], True))\r\ne.AddParticipant(New Participant( _\r\n\t&quot;Alice&quot;, &quot;alice@mail.com&quot;, ParticipationRole.Required, True))\r\n\r\nDim alarm As Alarm = e.AddAlarm()\r\nalarm.BeforeStart(TimeSpan.FromMinutes(15))\r\n\r\nMail.Text(&quot;Status meeting at 4PM.&quot;) _\r\n\t.Subject(&quot;Status meeting&quot;) _\r\n\t.From(&quot;alice@mail.com&quot;) _\r\n\t.&#x5B;To](&quot;bob@mail.com&quot;) _\r\n\t.AddAppointment(appointment) _\r\n\t.UsingNewSmtp() _\r\n\t.WithCredentials(&quot;alice@mail.com&quot;, &quot;password&quot;) _\r\n\t.Server(&quot;smtp.mail.com&quot;) _\r\n\t.WithSSL() _\r\n\t.Send()\r\n<\/pre>\n<p>You can download <a href=\"\/mail\">Mail.dll .NET email component here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Mail.dll .NET email component includes support for popular iCalendar standard. iCalendar is used by most popular email clients like Outlook or Gmail. It allows Internet users to send meeting requests and tasks to other users, via email, or sharing files with an extension of .ics. Recipients of the iCalendar data file (with supporting software, such [&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-886","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\/886"}],"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=886"}],"version-history":[{"count":4,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/886\/revisions"}],"predecessor-version":[{"id":5491,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/886\/revisions\/5491"}],"wp:attachment":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/media?parent=886"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/categories?post=886"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/tags?post=886"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}