Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Email Calendar Appointments
#4
(09-28-2018, 10:26 AM)leeparvin Wrote: Still no luck.  However, by setting the attachment contenttype = 'text/plain' instead of 'text/calendar' fixed the problem.

But then it won't be identified as an ICS file anymore by automated processors.  The "Content-Type" matters.

(09-28-2018, 10:26 AM)leeparvin Wrote:     idTextPart.Body.Append('BEGIN:VCALENDAR');
.....
    idTextPart.Body.Append('END:VCALENDAR');

    Calendar.Append('BEGIN:VCALENDAR');
......
    Calendar.Append('END:VCALENDAR');

    Calendar.SaveToFile(CalendarFile);

You don't need to duplicate the calendar data like that.  I would populate just the Calendar object and then Assign() it to idTextPart.Body.  Or get rid of the Calendar object and call idTextPart.Body.SaveToFile().

On the other hand, you don't need a temp file at all if you use TIdAttachmentMemory instead of TIdAttachmentFile.

(09-28-2018, 10:26 AM)leeparvin Wrote:     Attachment:=TIdAttachmentFile.Create(MailMessage.MessageParts, CalendarFile);
    Attachment.ContentType:='text/plain';  -< THIS WORKED!!!!
////    Attachment.ContentType:='text/calendar';  -< THIS DID NOT WORK!!!
    Attachment.FileName := CalendarFile;

You are missing the 'method' attribute again on the ContentType.  That attribute is REQUIRED by RFC 6047 Section 2.4.

Reply


Messages In This Thread
Email Calendar Appointments - by leeparvin - 09-27-2018, 09:23 AM
RE: Email Calendar Appointments - by rlebeau - 09-27-2018, 08:11 PM
RE: Email Calendar Appointments - by leeparvin - 09-28-2018, 10:26 AM
RE: Email Calendar Appointments - by rlebeau - 09-28-2018, 04:53 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)