Skip to main content
AndyPetersonCFUGMgr
Participating Frequently
February 21, 2019
질문

Example of how to "attach a callback handler to the CFMAIL tag to get delivery notifications."

  • February 21, 2019
  • 2 답변들
  • 747 조회

Hi. I've been looking at the ColdFusion feature list and under Email Management, I read "Attach a callback handler to the CFMAIL tag to get delivery notifications." Can anyone provide a link to an example of what this looks like? Thanks in advance.

    이 주제는 답변이 닫혔습니다.

    2 답변

    BKBK
    Community Expert
    Community Expert
    February 24, 2019

    AndyPetersonCFUGMgr  wrote

    Hi. I've been looking at the ColdFusion feature list and under Email Management, I read "Attach a callback handler to the CFMAIL tag to get delivery notifications."

    I know of two notifications:

    (1)

    <cfmail failTo="admin@domain.com">

    </cfmail>

    which sets the mail envelope reverse-path, the e-mail address to which the recipient's mail server should send delivery failure notifications.

    (2)

    <cfmail>

    <cfmailparam name="Disposition-Notification-To" value="someone@somedomain.com">

    </cfmail>

    which triggers a receipt notification prompt when the recipient opens the mail. Were the recipient to click on OK, a read-confirmation would be sent to the sender. There are more values of the name attribute of cfmailparam, including:

    Message-Context

    Apparently-To

    Approved-By

    Fax

    Telefax

    For-Approval

    For-Comment

    For-Handling

    Mail-System-Version

    Mailer

    Originating-Client

    X-Mailer

    X-Newsreader

    X-MimeOLE

    User-Agent

    Originator-Info

    Phone

    X-Envelope-From

    Envelope-To

    X-Envelope-To

    X-Face

    X-RCPT-TO

    X-Sender

    X-X-Sender

    Posted-To

    X-Admin

    Errors-To

    Return-Receipt-To

    Read-Receipt-To

    X-Confirm-reading-to

    Return-Receipt-Requested

    Register-Mail-Reply-Requested-By

    Abuse-Reports-To

    X-Complaints-To

    X-Report-Abuse-To

    Content-Alias

    Delivered-To

    X-Loop

    Translated-By

    Translation-Of

    X-UIDL

    X-URI

    X-URL

    X-IMAP

    X-OriginalArrivalTime

    Precedence

    X-MSMail-Priority

    X-Priority

    Content-Length

    Content-Conversion

    Content-Class

    Content-SGML-Entity

    X-MIME-Autoconverted

    List-Digest

    Mailing-List

    X-Mailing-List

    List-Software

    List-URL

    X-Listserver

    X-List-Host

    Fcc

    Speech-Act

    Status

    X-No-Archive

    See cfmailparam CFML Documentation

    Community Expert
    February 25, 2019

    Yeah, I was expecting something to which we could directly attach code, but that sounds like a reasonable reading of the docs.

    Dave Watts, Eidolon LLC

    Dave Watts, Eidolon LLC
    Community Expert
    February 23, 2019

    I can't find anything that describes how this should work. I found out that OpenBD has a way to do this, so I took a guess that CF 2018 might work the same way.

    CFMAIL / OpenBD CFML Manual

    In OpenBD, you can add a CALLBACK attribute to the CFMAIL tag, and point the value to a CFC with two methods to handle mail being sent or not - it's not clear whether the success handler method should be named onMailSend or onMailSuccess, but that's not important I guess since my testing didn't get that far.

    So I tried that in CF 2018, with a very simple component with two simple methods that did nothing except use CFLOG. But that didn't work. Instead, I got an error message from CF that the only allowed attributes for CFMAIL are:

    BCC,CC,CHARSET,DEBUG,ENCRYPT,ENCRYPTIONALGORITHM,FAILTO,FROM,GROUP,GROUPCASESENSITIVE,IDNAVERSION,KEYALIAS,KEYPASSWORD,KEYSTORE,KEYSTOREPASSWORD,MAILERID,MAXROWS,MIMEATTACH,PASSWORD,PORT,PRIORITY,QUERY,RECIPIENTCERT,REMOVE,REPLYTO,SERVER,SIGN,SPOOLENABLE,STARTROW,SUBJECT,TIMEOUT,TO,TYPE,USERNAME,USESSL,USETLS,WRAPTEXT.

    None of those look like they'd be used for a callback handler. So, my guess is that this feature was never actually put in, and that the marketing materials got slightly ahead of the actual product features.

    Dave Watts, Eidolon LLC

    Dave Watts, Eidolon LLC