accessing the delivery receipt using CDO.Message

Discussion in 'ASP General' started by Sany, Jun 20, 2007.

  1. Sany

    Sany Guest

    Helo,

    I am using myMail.DSNOptions = 14 n a script that uses CDO.Message to
    send an internal mail. Is there a way to access the delivery status in
    the same script and report a bad route...below is an example I would
    like to achieve. Any help is greatly appreciated.

    Example:


    Sub sendMail(msg)
    Set myMail=CreateObject("CDO.Message")
    myMail.Subject="Queues|Critical"
    myMail.From=""
    myMail.To=""
    myMail.TextBody=msg
    myMail.DSNOptions = 14
    myMail.Send
    set myMail=nothing

    <----------------------------If message not delivered Wscript.echo
    "mesage not delivered" else "great job" end if ------------->

    End Sub
    Sany, Jun 20, 2007
    #1
    1. Advertising

  2. Sany wrote on Wed, 20 Jun 2007 07:48:58 -0700:

    > Helo,
    >
    > I am using myMail.DSNOptions = 14 n a script that uses CDO.Message to
    > send an internal mail. Is there a way to access the delivery status in
    > the same script and report a bad route...below is an example I would
    > like to achieve. Any help is greatly appreciated.
    >
    > Example:
    >
    > Sub sendMail(msg)
    > Set myMail=CreateObject("CDO.Message")
    > myMail.Subject="Queues|Critical"
    > myMail.From=""
    > myMail.To=""
    > myMail.TextBody=msg
    > myMail.DSNOptions = 14
    > myMail.Send
    > set myMail=nothing
    >
    > <----------------------------If message not delivered Wscript.echo
    > "mesage not delivered" else "great job" end if ------------->
    >
    > End Sub


    Given that the delivery receipt might not be received for minutes, hours.,
    days, etc after sending, if at all, this isn't a simple thing to accomplish.
    Also, a DSN is returned to the From address as an email - this means that
    you'd need to poll the POP3/IMAP account for that address looking for the
    DSN in order to show the status.

    What you might be able to achieve is if you can connect to the recipient's
    SMTP server and get an immediate response (ie an error from the Send method)
    which would indicate if the account exists or not. It won't always work (for
    example, the recipient server might be a simple relay that doesn't validate
    the existence of addresses during the SMTP conversation), but as you say
    you're sending these internally then this might well be the solution you're
    looking for.

    Dan
    Daniel Crichton, Jun 21, 2007
    #2
    1. Advertising

  3. "Daniel Crichton" <> wrote in message
    news:...
    > Sany wrote on Wed, 20 Jun 2007 07:48:58 -0700:
    >
    > > Helo,
    > >
    > > I am using myMail.DSNOptions = 14 n a script that uses CDO.Message to
    > > send an internal mail. Is there a way to access the delivery status in
    > > the same script and report a bad route...below is an example I would
    > > like to achieve. Any help is greatly appreciated.
    > >
    > > Example:
    > >
    > > Sub sendMail(msg)
    > > Set myMail=CreateObject("CDO.Message")
    > > myMail.Subject="Queues|Critical"
    > > myMail.From=""
    > > myMail.To=""
    > > myMail.TextBody=msg
    > > myMail.DSNOptions = 14
    > > myMail.Send
    > > set myMail=nothing
    > >
    > > <----------------------------If message not delivered Wscript.echo
    > > "mesage not delivered" else "great job" end if ------------->
    > >
    > > End Sub

    >
    > Given that the delivery receipt might not be received for minutes, hours.,
    > days, etc after sending, if at all, this isn't a simple thing to

    accomplish.
    > Also, a DSN is returned to the From address as an email - this means that
    > you'd need to poll the POP3/IMAP account for that address looking for the
    > DSN in order to show the status.


    An alternative address for the disposition note to be sent to can be set
    using:-

    myMail.Fields("urn:schemas:mailheader:disposition-notification-to") =
    ""
    myMail.Fields.Update

    Add a "servermail" mail domain (which allows relays only from local addesses
    and doesn't foward) to a local SMTP server (I typically have one installed
    on the same server as my ASP is running). Make sure the local DNS service
    has a MX record for it.

    Now the dispostion notes end up as *.eml files in the servers drop folder.
    This can be polled for eml files and the notes can then be consumed. Of
    course this is still an asynchronous process.
    Anthony Jones, Jun 21, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Larry

    delivery acknowledgement with CDO

    Larry, Oct 6, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    355
    Larry
    Oct 6, 2004
  2. Chris Thunell

    system.web.mail Delivery Receipt?

    Chris Thunell, Oct 11, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    2,385
    Curt_C [MVP]
    Oct 11, 2004
  3. =?Utf-8?B?S29zdGFkaW4gS29zdG92?=

    Request delivery receipt when sending mails

    =?Utf-8?B?S29zdGFkaW4gS29zdG92?=, Mar 7, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    1,743
    =?Utf-8?B?QWxiZXJ0IFBhc2N1YWw=?=
    Mar 7, 2005
  4. =?Utf-8?B?S29zdGFkaW4gS29zdG92?=

    Request delivery receipt

    =?Utf-8?B?S29zdGFkaW4gS29zdG92?=, Mar 11, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    499
    =?Utf-8?B?S29zdGFkaW4gS29zdG92?=
    Mar 11, 2005
  5. Greg Sedeo

    Read receipt with CDO 2000

    Greg Sedeo, Nov 9, 2003, in forum: ASP General
    Replies:
    2
    Views:
    214
    Greg Sedeo
    Nov 9, 2003
Loading...

Share This Page