09-27-2018, 09:23 AM
Hi there
Im trying to email a calendar appointment to outlook, that shows the email as an appointment (with Accept,Decline at the top of the email etc) with an .ics icalendar file attached. Basically, its the sames as sending an appointment from Googles gmail to MS Outlook.
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';
I can also send an .ics attatchment with plain text email with ....
Attachment:=TIdAttachmentFile.Create(MailMessage.MessageParts, CalendarFile) ;
Attachment.ContentType:='text/calendar';
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.
Do you have any suggestions on how to send the email with MessageParts, but with the main MailMessage.ConentType = 'text/calendar'.
Many thanks
Lee Parvin
Im trying to email a calendar appointment to outlook, that shows the email as an appointment (with Accept,Decline at the top of the email etc) with an .ics icalendar file attached. Basically, its the sames as sending an appointment from Googles gmail to MS Outlook.
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';
I can also send an .ics attatchment with plain text email with ....
Attachment:=TIdAttachmentFile.Create(MailMessage.MessageParts, CalendarFile) ;
Attachment.ContentType:='text/calendar';
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.
Do you have any suggestions on how to send the email with MessageParts, but with the main MailMessage.ConentType = 'text/calendar'.
Many thanks
Lee Parvin