Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Email Calendar Appointments
#2
(09-27-2018, 09:23 AM)leeparvin Wrote: I can send the email appointment OK with ....

    MailMessage.From.Address := 'mail@server.com';
    MailMessage.Recipients.EMailAddresses := 'lparvin@bjphomesupport.co.uk';
    MailMessage.Subject     := 'Send calendar';
    MailMessage.ContentType := 'text/calendar;method=REQUEST';

That will only work if you load the *content* of the ICS file into the TIdMessage.Body property.

(09-27-2018, 09:23 AM)leeparvin Wrote: I can also send an .ics attatchment with plain text email with ....

    Attachment:=TIdAttachmentFile.Create(MailMessage.MessageParts, CalendarFile) ;
    Attachment.ContentType:='text/calendar';

That should work fine, after you add the missing 'method' attribute:

Code:
Attachment.ContentType := 'text/calendar;method=REQUEST';

(09-27-2018, 09:23 AM)leeparvin Wrote: However, I can NOT combine the two, ie send the email appointment with the .ics file attached.

As soon I set  MailMessage.ContentType to anything other than   'text/calendar;method=REQUEST'; eg change it to 'multipart/alternative', it fails.

See Multipart email with text and calendar: Outlook doesn't recognize ics.

If you still can't get it to work, then please show your complete code to populate the TIdMessage.

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)