SmtpMail.AutoCalendar Property


Specifies the e-mail generates text/calendar body with ics attachment automatically. Default is true.

[Visual Basic]
Public Property AutoCalendar As Boolean
[C#]
public bool AutoCalendar {get; set;}
[C++]
public: __property bool get_AutoCalendar();
public: __property void set_AutoCalendarbool);
[JScript]
public function get AutoCalendar() : bool;
public function set AutoCalendar(bool);

Property Value

If an ics attachment is attached to the email, seting AutoCalendar to true indicates alternative text/calendar body will be generated automatically. You can use this property to generate and send an email calendar.

Example

[C# - Send Meeting Request]
SmtpMail oMail = new SmtpMail("TryIt");

oMail.AutoCalendar = true;
oMail.TextBody = "This is a calendar invitation";
oMail.AddAttachment("d:\invite.ics");

Console.WriteLine(System.Text.Encoding.ASCII.GetString(oMail.EncodedContent));

//Output
/*
Message-ID: <6df24faceb69c51460c17fa0001bee3f@>
From: <>
Subject:
Date: Tue, 07 Feb 2012 16:10:50 +0800
MIME-Version: 1.0
Content-Type: multipart/mixed;
        boundary="19e870f174a01887d5803516000f18e1"

This is a multi-part message in MIME format.

--19e870f174a01887d5803516000f18e1
Content-Type: multipart/alternative;
        boundary="19e870f174a01887d5803516000f18e0"


--19e870f174a01887d5803516000f18e0
Content-Type: text/plain;
        charset="utf-8"
Content-Transfer-Encoding: quoted-printable

This is a calendar invitation

--19e870f174a01887d5803516000f18e0
Content-Type: text/calendar; charset=utf-8; method=REQUEST
Content-Transfer-Encoding: base64

[encoded calendar part]
--19e870f174a01887d5803516000f18e0--

--19e870f174a01887d5803516000f18e1
Content-Type: text/calendar;
        name="invite.ics"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
        filename="invite.ics"

[encoded calendar attachment]
--19e870f174a01887d5803516000f18e1--

*/