//  home   //  advanced search   //  news   //  categories   //  sql build chart   //  downloads   //  statistics
 ASP FAQ 
Home
ASP FAQ Tutorials

   8000XXXX Errors
   Alerts
   ASP.NET 2.0
   Classic ASP 1.0
      COM / ActiveX Components
      Forms
      General Topics
      Date/Time Routines
      Email Scripts & Info
      Files/Directories & FSO
   Databases
   General Concepts
   Search Engine Optimization (SEO)

Contact Us
Site Map

Search

Web
aspfaq.com
tutorials.aspfaq.com
classicasp.aspfaq.com

ASP FAQ Tutorials :: Classic ASP 1.0 :: Email Scripts & Info :: Can I get CDO messages to return a read receipt?


Can I get CDO messages to return a read receipt?

Here is some code that will set up a read receipt with CDO.Message: 
 
<!--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  
%>
 
Keep in mind that this won't necessarily tell you that the user has actually read and understood the message, only that they've opened it; and, also, that both Outlook and Outlook Express (and perhaps other clients as well) support the ability to turn off read receipts (either per instance or globally). 
 
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  
    '... 
%>
 
Note that this will send a message to you that has no subject and no from address, and a large cryptic body telling you that the message was delivered successfully. There is a good chance your mail server, or anti-spam programs, will mark it as spam. So, test it out in your environment before assuming it will work... 
 

Previously, this article had stated that the technique did not work. Ironically, all of my test e-mails were sent to mailboxes that had the "never send a read receipt" option enabled. Hey, you get what you pay for here. <G>

Related Articles

Can I use a remote SMTP server with CDONTS.NewMail?
How do I alter the priority / importance of an e-mail message?
How do I prevent my links from wrapping in an e-mail?
How do I put carriage returns into an e-mail?
How do I send e-mail from ASP?
How do I send e-mail from SQL Server?
How do I send e-mail in HTML format?
How do I send e-mail with CDO?
How do I validate an e-mail address?
Should I use form action=mailto: to mail the results of a form?
Where can I get more details about configuring / using CDO?
Why can't ASP handle 80,000 e-mails?
Why do CDONTS messages end up in the badmail folder?
Why do I get 8000900F errors?
Why do I get 80040108 errors?
Why do I get 8004020A errors?
Why do I get 80090020 errors?
Why do I get C00402CE / C00402C7 errors?
Why does CDO.Message give 800C000D errors?
Why does CDO.Message give me 8004020F errors?
Why does CDO.Message give me 80040213 errors?
Why does CDO.Message give me 80040222 errors?
Why does my CDONTS mail hang out in the queue or pickup folders?
Why is e-mail to certain domains being rejected?

 

 


Created: 2/13/2002 | Last Updated: 12/14/2003 | broken links | helpful | not helpful | statistics
© Copyright 2006, UBR, Inc. All Rights Reserved. (334)

 

Copyright 1999-2006, All rights reserved.
Finding content
Finding content.  An error has occured...