简体   繁体   中英

Specify the name for a .ics file created

I am using the implementation provided in the link below to create a ics file as an outlook appointment reminder. It seems to be working fine, but I am not able to specify the name of the file that is attached.

vCalendar Implementation

Any help will be much appreciated. I would like the attachment to be name Appointment Reminder.ics

Thanks!

The implementation you linked shows how to send the calendar entry as an alternative view, not as an attachment. I'm guessing that you also want people to see it as an attachment. In that case you just need to attach a file to the same message:

msg.Attachments.Add(Attachment.CreateAttachmentFromString(
     str.ToString(), "Appointment Reminder.ics"));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM