Using ColdFusion CFMail to send Microsoft Outlook Appointment Request
CFMail , ColdFusion - Author:John Gag at 3:51 PM Add commentsI was asked to find a way to send a Microsoft Outlook Appointment Request email using ColdFusion cfmail tag. I was very much in luck with ColdFusion 8. Below is cfmail code I found that produces the outlook meeting request.
| <cfmail to="test@test.com" from="youremail@test.com" subject="Test appointment" type="multipart"> <cfmailparam name="content-class" value="urn:content-classes:calendarmessage"> <cfmailparam name="content-type" value="text"> <cfmailparam name="method" value="request"> <cfmailparam name="charset" value="utf-8"> <cfmailparam name="content-transfer-encoding" value="7bit"> <cfmailpart type="text"> TEST TEST TEST </cfmailpart> <cfmailpart type="text/calendar"> BEGIN:VCALENDAR PRODID:-//Microsoft Corporation//Outlook 11.0 MINMEDIR//EN VERSION:2.0 METHOD:PUBLISH BEGIN:VEVENT DTSTART:20080317T123000Z DTEND:20080317T133000Z LOCATION: Reno TRANSP:OPAQUE SEQUENCE:0 UID:0 DTSTAMP:20080303T140000Z DESCRIPTION:Descriptive text here.\n SUMMARY:Short summary here PRIORITY:5 X-MICROSOFT-CDO-IMPORTANCE:1 CLASS:PUBLIC END:VEVENT END:VCALENDAR </cfmailpart> </cfmail> |
All you need to do is setup a simple input form and call the appropriate variables needed (recipient email, body of email, DTSTART, DTEND etc.). For more information on how to create a vCalendar file check out the following link http://support.microsoft.com/kb/287625






Nov 12, 2008 at 11:40 PM I have a similar blog entry describing a UDF I wrote for generating an iCalendar file which could then be emailed. http://blog.webdh.com/index.cfm/2008/3/21/Generating-an-iCalendar-ics-file
Nov 13, 2008 at 9:55 AM @Troy - Cool, I will have to check that out
Feb 25, 2009 at 4:03 PM This builds an ICS file OK. Something is fishy though. When other applications send me a message with an ICS attached, my iphone will pop up and tell me there is an appointment. However this method doesnt do that. Anone have a fix for the seemless integration to the iphone? Other apps create ICS files that do this so I suppose it is possible.
Mar 29, 2009 at 11:39 PM how does one make the user accept the meeting request ? Im truly baffled by how that part works ? any ideas ?
Apr 1, 2009 at 6:24 PM @Anthony - Sorry I do not know the answer to the iPhone problem. @Dave - I am not really sure what your question is?
Jun 16, 2009 at 4:08 AM Very cool!! is there anyway I can adapt to get an accept response from the sender?
Jun 16, 2009 at 11:19 AM @Jas - I have not not tried that. Thats a good question. I would like to know how that goes if you figure it out.
Sep 25, 2009 at 12:00 PM Nice man! Hey, how can I import a contact list from, let's say: Outlook (not using MS Exchange), Mac Mail, Yahoo!, etc.? thanks, Hamelt
Sep 30, 2009 at 7:24 AM Hey, this works great! Really cool! Any idea how to update or delete a calendar item after it's sent from CF?
Sep 30, 2009 at 9:43 AM @Lauren - My next project is going to deal a lot with Exchange, I will let you know what I find out.
Oct 28, 2009 at 9:45 AM @Lauren - The way I understand it is, you have to give the item a unique UID. If you post an other item with the same UID then it should be updated. See for more info: http://en.wikipedia.org/wiki/ICalendar Haven't tried it myself, yet.
Jan 20, 2010 at 1:16 PM i had tried with no luck. i am using cf 9. the email that i received only contain the first part. there no meeting request in the email. any advise?
Jan 20, 2010 at 1:19 PM @crazymocker - What exactly are you getting? Do you mind emailing me a snippet of your code?
Jan 20, 2010 at 1:26 PM this is my code.. same code as yours with some changes for the variables. i just get the normal email with the "TEST TEST TEST" content only. no meeting request.
Jan 20, 2010 at 1:45 PM sorry for the messy post. here's the link to my code. http://www.dewarisan.com.my/cfappointment.cfm really appreciate if you could help
Jan 20, 2010 at 1:47 PM @crazymocker - I will take a look in a sec
Jan 20, 2010 at 2:09 PM @crazymocker - I have not done this in a while and when I tried I in CF9 I had the same problem as you. I will have to further investigate but I dont have time at the moment. I will try to post something later if I figure it out when I have more time. Sorry
Jan 22, 2010 at 6:22 AM I was having the same problems as crazymocker, although on CF8 (Developer). My solution was removing white space! Although I had copied the code directly, I like to layout my code with plenty of tabs....but this was the problem. Remove all tabs/spaces at the start of each vCalendar line.
Jan 22, 2010 at 7:07 AM @John - good to hear that works for you but not for me. do you mind take a look at my coding. the link in the comment no 15. i am quite sure that i don't have that tabs/spaces at the start.
Jan 22, 2010 at 11:18 AM John, I am using your code for a reminder notice. First off thanks for the leg work on this! I have this working like a charm if I have it as a regular page that I access with my variables however when I move this into a CFC Function and call it on my main page I get an email instead of the reminder notice. I used the exact same code from the cfm page into my cfc function. Any ideas as to why this happens? I am still working on a solution and will let you know if I figure out why. In the meantime any advice would be greatly appreciated! Thanks again!
Feb 23, 2010 at 9:25 AM Has anyone successfully done this for Outlook Contacts? Can you use custom fields also?