How to send a calendar event/meeting invitation email through ASP Classic?

Hi Experts,

We have a simple email form that needs to send out meeting invitations. At first we thought that we just need to create an iCalendar file (.ics) with the meeting details in it, then attach it to the ASP page generated email. Apparently it didnt work, we just received a simeple mail with an attachment and thats all. We need it to work definitely on Gmail as first requirement, then make it work with Live Mail and Outlook.

Is there something that we need to add to the email headers so that gmail will recognize it as a meeting invitation? Please see the image attached image for reference. The email should contain the Yes/Maybe/No buttons when we receive the mail. We are doing this in ASP Classic, using CDOSys mail component.

Thanks a lot!
sampleEvent.PNG
MicroCreativesAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sweetsathishCommented:
Collaboration Data Objects (CDO) creates a meeting request from an
Appointment object by using theIAppointment.CreateRequest method.
Tosend a meeting request
  1. Create or open an Appointment object.
  2. Add attendees to the meeting by adding Attendee objects     to the Appointment's Attendees collection.
  3. Save the Appointment to the organizer's calendar     (optional).
  4. Create a CalendarMessage object using the IAppointment.CreateRequest method.
  5. Send the message requesting that the users attend the     meeting.
Attached code is in Visual Basic Language. You can convert that code to ASP as
there wont be much differnce between VB and VBscript.

Sub SendMeetingRequest(iAppt As CDO.Appointment, _
                        iMbx As IMailbox, _
                        strAttnMandatory() As String, _
                        strAttnOptional() As String)

    Dim iCalMsg     As CalendarMessage
    Dim Config      As New Configuration
    Dim iAttendee   As New Attendee
    Dim iPers       As CDO.Person

    'Set the configuration fields
    Set iPers = iMbx
    Config(cdoSendEmailAddress) = iPers.Email
    Config(cdoMailboxURL) = iMbx.BaseFolder
    Config.Fields.Update

    With iAppt
        .Configuration = Config

        'Add attendees
        Dim I As Long
        For I = LBound(strAttnMandatory) To UBound(strAttnMandatory)
            Debug.Print "Mandatory Attendee E-Mail:" & strAttnMandatory(I)
            Set iAttendee = .Attendees.Add
            iAttendee.Address = CStr(strAttnMandatory(I))
            iAttendee.Role = cdoRequiredParticipant
        Next I

        For I = LBound(strAttnOptional) To UBound(strAttnOptional)
            Debug.Print "Optional Attendee E-Mail:" & strAttnOptional(I)
            Set iAttendee = .Attendees.Add
            iAttendee.Address = CStr(strAttnOptional(I))
            iAttendee.Role = cdoOptionalParticipant
        Next I

        'Create the calendar message and send it
        Set iCalMsg = .CreateRequest

        'Save these changes to the appointment
        .DataSource.Save

        iCalMsg.Message.Send
    End With

End Sub

Open in new window

0
MicroCreativesAuthor Commented:
@sweetsathish:Thanks! I will try this code
0
MicroCreativesAuthor Commented:
@sweetsathish: I ran into an error in the first line when i created a  aaointment object.

Code:
Set  iAppt =  CreateObject("Appointment")
Error:
Microsoft VBScript runtime  error '800a01ad'
ActiveX  component can't create object: 'CDO.Appointment'

Then I changed  it to Server. CreateObject
Code:
Set iAppt =   Server.CreateObject("CDO.Appointment")
 Error:
Server object error  'ASP 0177 : 800401f3'
 Server.CreateObject Failed

I  am running this webpage in Win2003 server, and I can definitely send  Emails using CDOSys.  I am not sure, but does this mean the code looks  for another component?
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

sweetsathishCommented:
CDO.Appointment indeed is part of cdoex.dll (Collaboration Data Objects for Exchange) that comes with some versions of Exchange, SPS and Office. If you cant find cdoex.dll in your machine. Try downloading it from the
http://www.google.nl/search?q=download+CDOEX.DLL

Refer the following links on the same subject:
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/ASP/Q_23589246.html
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/ASP/Q_21551707.html
http://msdn.microsoft.com/en-us/library/ms988680(v=EXCHG.65).aspx
0
MicroCreativesAuthor Commented:
Okay, i got the DLL registered and now i minto passing the iMailbox parameter. Does this mean i have to pass an actual mailbox object (with account) ? where does it come from?

The other code that you gave looks good, i will try them as well.
0
sweetsathishCommented:
It should be the actual mail box object. Whichever code works for you, use it. And dont forget to marked as answer.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MicroCreativesAuthor Commented:
Expert is very good, but the solution did not meet our requirement(s).
0
MicroCreativesAuthor Commented:
Thanks sweetsathish, we did not push this through as we cannot embed this in Gmail. I think the solution can address those with Exchange Servers/Mail servers in their office. We cant create a Gmail mailbox object, nor Google would expose it externally. One possibility is just try to use Gmail API. This is by far as per our findings, but please correct me if i am wrong. We might use a different approach now. Thanks a lot!
0
sweetsathishCommented:
Thanks MicroCreatives. CDO is meant for exchange server. I am not sure about the Gmail mailbox API. But, I am not sure whether there is any API for Gmail Mailbox.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.