none
CDO.message and .VotingOptions RRS feed

  • Question

  • Hi,

    Thanks for taking the time to read my question.

    I am currently using CDO to send emails instead of using Outlook from Access due to the security settings in Outlook that I can't seem to get around. CDO works great.

    I'm wondering if anyone knows if it's possible to add VotingOptions and ReplyRecipients with CDO. I tried the following but it does not seem to work:

    Function SendMailVote(wTo As String, wFrom As String, tMsg As String, tSubject As String, tReplyRec As String, Optional tAtt As String) 'system error messages
    'http://www.rondebruin.nl/win/s1/cdo.htm
    Dim iMsg As Object
    Dim iConf As Object
    Dim Flds As Variant
    
        Set iMsg = CreateObject("CDO.Message")
        Set iConf = CreateObject("CDO.Configuration")
    
            'iConf.Load -1    ' CDO Source Defaults
            Set Flds = iConf.Fields
            With Flds
                .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
                .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
                               = "smtp.nutreco.local"
                .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
                .Update
            End With
        
        With iMsg
            Set .Configuration = iConf
            .To = wTo
            .CC = ""
            .BCC = ""
            .FROM = wFrom
            .Subject = tSubject
            .HTMLBody = tMsg
            .VotingOptions = "Accept;Reject;Follow Up" 'Fails
            .ReplyRecipients.Add "Reply@TestReply.com" 'Fails
            .Send
        End With
    End Function

    Any help would be great.

    Thanks,
    Brad

    Update: I found this

    .replyto =

    to replace .ReplyRecipients.Add

    and it works.

    • Edited by mbrad Thursday, October 22, 2015 3:22 AM update
    Thursday, October 22, 2015 2:57 AM

Answers

  • I abandoned the voting option and am having users put Yes or No in the message body, then when I get the email back, I read the first 3 characters of the message to see what was sent.

    Outlook has too much security and is not feasible for me. Also, I'm using my DB in a Citrix environment and don't want to have Outlook installed and running for each instance of my DB.

    Thanks,
    Brad

     
    • Marked as answer by mbrad Tuesday, November 3, 2015 5:46 PM
    Tuesday, November 3, 2015 5:46 PM

All replies

  • > due to the security settings in Outlook that I can't seem to get around.

    I don't know, but I do know Outlook Redemption is a great tool that uses low level calls to get around the Outlook security prompts. Well worth it, IMHO.


    -Tom. Microsoft Access MVP


    Thursday, October 22, 2015 3:41 AM
  • >>>I'm wondering if anyone knows if it's possible to add VotingOptions and ReplyRecipients with CDO.

    Although the Collaboration Data Objects (CDO) 1.2.1 object library could be used with Microsoft Outlook 2010 and Microsoft Outlook 2013, we do not recommend or support this in any way.

    So I suggest that you could send emails with using Outlook from Access, you could refer to below code:

    Note: Add "Microsoft.Outlook.Object.Libary" reference

    Dim olApp As Outlook.Application
    
    Dim olMail As MailItem
    
    Set olApp = CreateObject("Outlook.Application")
    
    Set olMail = olApp.CreateItem(olMailItem)
    
    With olMail
    
         .To = ""
    
         .CC = ""
    
         .BCC = ""
    
         .Subject = ""
    
         .HTMLBody = ""
    
         .VotingOptions = "Accept;Reject;Follow Up"
    
         .ReplyRecipients.Add "Reply@TestReply.com"
    
         '.Send
    
         .Display
    
    End With
    
    Set olApp = Nothing
    
    Set olMail = Nothing
    

    For more information, click here to refer about Collaboration Data Objects (CDO) 1.2.1 is not supported with Outlook 2010 and later versions

    • Proposed as answer by David_JunFeng Tuesday, November 3, 2015 2:43 PM
    Friday, October 23, 2015 8:56 AM
  • I abandoned the voting option and am having users put Yes or No in the message body, then when I get the email back, I read the first 3 characters of the message to see what was sent.

    Outlook has too much security and is not feasible for me. Also, I'm using my DB in a Citrix environment and don't want to have Outlook installed and running for each instance of my DB.

    Thanks,
    Brad

     
    • Marked as answer by mbrad Tuesday, November 3, 2015 5:46 PM
    Tuesday, November 3, 2015 5:46 PM