?
Solved

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

Posted on 2010-04-07
9
Medium Priority
?
3,545 Views
Last Modified: 2012-06-27
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
0
Comment
Question by:MicroCreatives
  • 5
  • 4
9 Comments
 
LVL 1

Expert Comment

by:sweetsathish
ID: 30092928
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
 

Author Comment

by:MicroCreatives
ID: 30094963
@sweetsathish:Thanks! I will try this code
0
 

Author Comment

by:MicroCreatives
ID: 30097822
@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 new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
LVL 1

Expert Comment

by:sweetsathish
ID: 30099172
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
 

Author Comment

by:MicroCreatives
ID: 30101121
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
 
LVL 1

Accepted Solution

by:
sweetsathish earned 1500 total points
ID: 30101395
It should be the actual mail box object. Whichever code works for you, use it. And dont forget to marked as answer.
0
 

Author Closing Comment

by:MicroCreatives
ID: 31712167
Expert is very good, but the solution did not meet our requirement(s).
0
 

Author Comment

by:MicroCreatives
ID: 30675961
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
 
LVL 1

Expert Comment

by:sweetsathish
ID: 30787691
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

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After a recent Outlook migration from a 2007 to 2010 environment, some issues with Distribution List owners were realized. In this article, I explain how that was rectified.
There’s hardly a doubt that Business Communication is indispensable for both enterprises and small businesses, and if there is an email system outage owing to Exchange server failure, it definitely results in loss of productivity.
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?

600 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question