SitePoint Sponsor

User Tag List

Results 1 to 1 of 1
  1. #1
    SitePoint Member
    Join Date
    Oct 2013
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need help understanding CF code

    Hi all, I am not a CF programmer, but inherited a bunch of files from someone who left. I'm trying to understand the code in this fragment.

    Thanks for your help, Scott

    Code:
        <cfset StartRow = 1>
        <cfset Filepath =     "\UserData\Attachments\">
        <cfset PopUserName = "MailboxName">
        <cfset PopPassword =  trim('Password')>
        
        <cfset HaveMsg = 0>
    
        <cftry>
            <cfpop action="getall" 
                name="GetMail" attachmentpath="\\ServerName\e$\DataFolder\" 
                startrow="1" maxrows="100" 
                server="mail.example.org" 
                username="#PopUserName#" 
                password="#PopPassword#" generateuniquefilenames="yes">
            
            <cfcatch type="Any">
                <cfif not isdefined("SilentPop")>
                    <hr />
                    1. Unable to Connect to Mail Server<br />
                    2. #cfcatch.message#<br />
                    3. #cfcatch.detail#
                    <hr />
                    <cfdump var="#cfcatch.tagcontext#">
                </cfif>
                <cfabort>
            </cfcatch>
        </cftry>
    
        <cfloop query="GetMail">
             <cfpop action="delete" 
                messagenumber="1"  
                server="mail.example.org" 
                username="#PopUserName#" 
                password="#PopPassword#">
        </cfloop>
    
        <cfif not isdefined("SilentPop")>
            Emails to Process: #GetMail.recordcount#<br />
        </cfif>
    Last edited by Force Flow; Oct 2, 2013 at 13:28. Reason: added code tags


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •