Send Calendar Invites through Exchange using CDO? (1 Viewer)

veraloopy

Registered User.
Local time
Today, 12:03
Joined
Apr 10, 2009
Messages
139
I've got some code that sends emails from a specific user account in Exchange where the user doesn't need to have Outlook open. However, I also need to send a calendar invite using information from fields in my form

Can anyone help with using similar but calling the calendar function to send the message as a calendar invite?

Any help is greatly appreciated.

Many thanks



Code:
Public Function SendMail(strEmailTo As String, strSubject As String, strBody As String)
Dim strMailServer As String
Dim strMailUser As String
Dim strMailPass As String
Dim strMailFrom As String

strMailServer = DLookup("MailServerAddress", "tblSettings")
strMailUser = DLookup("MailServerUser", "tblSettings")
strMailPass = DLookup("MailServerPass", "tblSettings")
strMailFrom = DLookup("MailServerFrom", "tblSettings")

    Dim mail    As CDO.Message
    Dim config  As CDO.Configuration
    
    Set mail = CreateObject("CDO.Message")
    Set config = CreateObject("CDO.Configuration")
    
    config.Fields(cdoSMTPAuthenticate).Value = cdoNTLM
    config.Fields(cdoSendUserName).Value = strMailUser
    config.Fields(cdoSendPassword).Value = strMailPass
    config.Fields(cdoSendUsingMethod).Value = cdoSendUsingPort
    config.Fields(cdoSMTPServer).Value = strMailServer
    config.Fields(cdoSMTPServerPort).Value = 25
    config.Fields.Update
    
    Set mail.Configuration = config
    
    With mail
        .To = strEmailTo
        .From = strMailFrom
        .Subject = strSubject
        .TextBody = strBody
        .Send
    End With
    
    Set config = Nothing
    Set mail = Nothing
    
End Function
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 06:03
Joined
Feb 28, 2001
Messages
27,186
After a little bit of web searching, I found this:


CDO is a raw, basic SMTP product, but Exchange Calendar items are not basic. A calendar invite is in a special format that is sent as an attachment to an e-mail message. IF you can synthesize the attachment file, you can attach it to a CDO message. But the trick is to find someone who successfully sent that attachment in the proper format. I have not found an Access/CDO example so far in my searches. Therefore, I can offer no code to do that synthesis.

My opinion (clearly stated as such) is that if you have Outlook and really wanted to send an invite, send it using Outlook. The user receiving the invite doesn't have to have Outlook open at the time, but just won't get the invite until they DO open Outlook. And with CDO, any message you send is the same way. The users don't have to have anything open at the time of transmission but, per SMTP protocol, won't get anything until they launch their mail handler client. SMTP is based on a store-and-forward protocol, so the SMTP gateway or server will hold all messages until the mail client requests each one, no matter whether it was sent via Outlook or Exchange or CDO.
 

veraloopy

Registered User.
Local time
Today, 12:03
Joined
Apr 10, 2009
Messages
139
After a little bit of web searching, I found this:


CDO is a raw, basic SMTP product, but Exchange Calendar items are not basic. A calendar invite is in a special format that is sent as an attachment to an e-mail message. IF you can synthesize the attachment file, you can attach it to a CDO message. But the trick is to find someone who successfully sent that attachment in the proper format. I have not found an Access/CDO example so far in my searches. Therefore, I can offer no code to do that synthesis.

My opinion (clearly stated as such) is that if you have Outlook and really wanted to send an invite, send it using Outlook. The user receiving the invite doesn't have to have Outlook open at the time, but just won't get the invite until they DO open Outlook. And with CDO, any message you send is the same way. The users don't have to have anything open at the time of transmission but, per SMTP protocol, won't get anything until they launch their mail handler client. SMTP is based on a store-and-forward protocol, so the SMTP gateway or server will hold all messages until the mail client requests each one, no matter whether it was sent via Outlook or Exchange or CDO.
I understand, I read something along the same lines but the article was some years back so I was hoping things had changed.

Many thanks for your help :)
 

Users who are viewing this thread

Top Bottom