4 Replies Latest reply on May 8, 2010 4:45 PM by Is this one taken?

    cfexchangemail - message attachments

    Is this one taken?

      Hi there

       

      I have noticed that a number of people have enquired for solutions to the inability of the cfexchangemail tag to return meaningful or useful data for attchments to emails which are themselves emails. CF does not appear to be capable of retrieving the attachment. The cfexchangemail tag knows the attachment is there and knows the size of the attachment, but no information is available to retrieve the email.

       

      ATTACHMENTFILENAME: [empty string]
      ATTACHMENTFILEPATH: [empty string]
      CID: [empty string]
      ISMESSAGE: YES
      MIMETYPE: [empty string]
      SIZE: 4567

       

      Has anyone managed to crack this one, or is it still in the Adobe bug box?

       

      Salute

       

      Boon

        • 1. Re: cfexchangemail - message attachments
          JimGroves

          Hello,

           

          For Exchange 2003 it seems to work, but I have never been able to get it to work for Exchange 2007.  Guessing 2010 does not work either.

          1 person found this helpful
          • 2. Re: cfexchangemail - message attachments
            Is this one taken? Level 1

            Hi there

             

            Thank you for the ray of light.  I am using Windows w2k3 hosting Exchange 2003.

             

            I am in the process of develolping a prototype, and am using what is essentially the code used in the CF documentation for cfexchangemail, as set out below.

             

            Would you mind letting me know whether you using (1) any particular configuration settings on either CF, IIS (for OWA) or Exchange or (2) vanilla settings on each application?

             

            Regards

             

            Boon

             

             

            ---------------

             

            <cfexchangeconnection action="open" connection="testconn1" server="[IP address only, no http, no https, server side redirect to /exchange]" username="[user]" password="[password]" formbasedauthentication="false">

            <cfexchangemail action="get" folder="Inbox" name="weeksMail" connection="testconn1">
            </cfexchangemail>

            All Emails:<br />
            <cfdump var="#weeksMail#">


            <cfloop query="weeksMail">
                <cfif weeksmail.HasAttachment>
                    <cfexchangemail action="getAttachments" connection="testconn1" folder="Inbox" uid="#weeksmail.uid#" 
                        name="attachData" attachmentPath="d:\cf_files\attachments\msg_#i#" generateUniqueFilenames="yes">
                    <cfoutput>
                        Message ID #weeksmail.uid# attachments are in the directory
                            d:\cf_files\attachments\Msg_#i#<br />
                        <br />
                            Message information:<br />
                            Subject: #weeksmail.Subject#<br />
                            Sent: #dateFormat(weeksmail.TimeSent)#<br />
                            From:  #weeksmail.FromID#<br />
                        <br />
                        Attachments<br />
                        <cfdump var="#attachData#">
                        <cftable query="attachData" colheaders="yes">
                            <cfcol header="File Name" text="#attachmentFilename#">
                            <cfcol header="Size" text="#size#">
                            <cfcol header="MIME type" text="#mimeType#">
                        </cftable>
                    </cfoutput>
                    <br />------------------------------------------<br />
                    <cfset i++>
                </cfif>
            </cfloop>

             

            <cfexchangeconnection action="close" connection="testconn1">

            • 3. Re: cfexchangemail - message attachments
              Reed Powell Level 3

              Just an idea/alternative - if you are running CF9 then maybe the CFIMAP tag will help.  It means that the Exchange mailbox has to be setup with IMAP access, but in some cases I've had better luck with the CFIMAP route than the CFEXCHANGE one because the IMAP is using an actual API communication path from CF to Exchange, while the CFEXCHANGE method needs to use the hokey OWA communications path since there is no actual published Exchange API.  I've had messages show up in the Exchange inbox that are readable in both Outlook and OWA and which CFEXCHANGE could see in the list of messages but would fail at any attempt to extract their attachments.  It's always an adventure when I use the CFEXCHANGE tags.

              -reed

              • 4. Re: cfexchangemail - message attachments
                Is this one taken? Level 1

                Superb, thank your for your response.