rss search

Get CDO messages to return a read receipt?

line
<!--METADATA
    TYPE="typelib"
    UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
    NAME="CDO for Windows 2000 Library"
-->
<%
    ' since this doesn't *have* to match the from address
    receiptTo = "you@yourdomain.com"  

    Set cdoConfig = CreateObject("CDO.Configuration")
    Set cdoMessage = CreateObject("CDO.Message")  

    With cdoConfig.Fields
        .Item(cdoSendUsingMethod) = cdoSendUsingPort
        .Item(cdoSMTPServer) = "smtp.yourdomain.com"
        .Update
    End With  

    With cdoMessage
        .Fields(cdoDispositionNotificationTo) = receiptTo
        .Fields(cdoReturnReceiptTo) = receiptTo
        .Fields.Update  

        Set .Configuration = cdoConfig  

        .From = "you@yourdomain.com"
        .To = "them@theirdomain.com"
        .Subject = "Sample CDO Message"
        .TextBody = "This is a test for CDO.message"
        .Send
    End With  

    Set cdoMessage = Nothing
    Set cdoConfig = Nothing
%>

If you want to know about delivery in the event that a read receipt will never come, you can add a delivery status notification option of 4 (success) just before calling the .send method:

<%
    '...
        .DSNOptions = 4
        .Send
    '...
%>
Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter


Leave a Reply

You must be logged in to post a comment.

Devguru.in is Stephen Fry proof thanks to caching by WP Super Cache