Create Email That Allow Accept/Decline to Calendar

  • Thread starter Johnmichael Monteith
  • Start date
J

Johnmichael Monteith

I am attempting to create an email (using CDONTS) from an IIS server that
will be in a format that Outlook will recognize as a potential calendar
entry that someone would accept or decline. If they accept, the entry would
be placed in their calendar.

I looked at the code behind one of these emails and try to copy the format
to make it work, but it is not working.

At the end of this email is some example code.

Any thoughts or ideas on how to make this work (or whether it is even
possible -- I assume it must be), would be wonderful.

Thank you so much!

jp

-----------

Dim objMail

Const cdoBodyFormatHTML = 0

Const cdoMailFormatMIME = 0

strHTMLOpen = "<HTML><HEAD></HEAD><BODY>" & _

"<object ID=""Application""
classid=""CLSID:0005555B-0000-0000-C000-000000000555""></object>"

strHTMLClose = "</FONT></BODY></HTML>"

strScript = "<script language=vbcript>" & vbCrlF & _

"On Error Resume Next" & vbCrlF & _

"Set ApptItem = Application.CreateItem(1)" & vbCrlF & _

"ApptItem.BusyStatus = 0" & vbCrlF & _

"ApptItem.Recipients.Add (""Dummy Account"")" & vbCrlF & _

"ApptItem.Subject = ""Action Item Due""" & vbCrlF & _

"ApptItem.StartTime=""#01/01/05 1:00 PM#""" & vbCrlF & _

"ApptItem.Duration = 30" & vbCrlF & _

"ApptItem.Save" & vbCrlF & _

"</script>"

Err.Clear

Set objMail = Server.CreateObject("CDONTS.NewMail")

objMail.From=Trim(Request.Form("Email"))

objMail.To=strEmailContact

objMail.Subject="Testing"

objMail.BodyFormat = cdoBodyFormatHTML

objMail.MailFormat = cdoMailFormatMIME

objMail.Body= strScript & strHTMLOpen & Trim(Request.Form("Comments")) &
strHTMLClose

objMail.Send

Set objMail = Nothing

If Err.Number <> 0 Then

Response.Write Err.Description

Response.End

End If%>
 
S

Sue Mosher [MVP-Outlook]

Outlook doesn't run script on HTML format items, for security reasons. The correct approach would be to include an iCalendar MIME part in your message. See http://www.imc.org/pdi/ for details on the iCal specification.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top