Questions I am having are
a) Subject of the email that gets delivered always has as "Invitation:" in the beginning of subject along with START DATE and TITLE at the end of the subject.
b) When someone opens the email, before accepting the event, it has SUMMARY where it takes whatever is defined in SUBJECT. Is there a different property for this?
c) The body of the email has HTML characters and when I assign it to the 'description' the same it shows all HTML characters within the email.
d) Does the problem seems to be with "AddAlternateView"?? Is this line causing all of the previous values to get reset or is this line making any changes? I tried with AddCalendar (which is obsolete) but still no success.
Below is the code.
void AsposeTest(string cBody)
// cBody is a string that has body of the email that has TR, TD and other HTML characters.
DateTime dt1 = (DateTime) L1["EventDate"];
DateTime dt2 = (DateTime) L1["EndDate"];
string cFLName = L1["Requestor"].ToString();
string cTitle = L1["Title"].ToString();
string cEmail = "email@example.com";
MailMessage msg = new MailMessage();
msg.From = "firstname.lastname@example.org";
msg.To = cEmail;
msg.Subject = "Click ACCEPT to Add to Calendar"; // (" + cTitle + ")";
Appointment app = new Appointment(cTitle, new DateTime((int)dt1.Year, (int)dt1.Month, (int)dt1.Day, (int)dt1.Hour, (int)dt1.Minute, (int)dt1.Second), new DateTime((int)dt2.Year, (int)dt2.Month, (int)dt2.Day, (int)dt2.Hour, (int)dt2.Minute, (int)dt2.Second), msg.From, msg.To);
app.Summary = "Your request has been approved";
app.Description = cBody;
msg.IsBodyHtml = true;
//msg.HtmlBody = cBody;
//msg.Body = cBody;
msg.TextBody = cBody;
SmtpClient smtpClient = new SmtpClient(cSMTPClient);