Yep, that's another nifty feature of <cfpop>, the <cfcatch type="any">
doesn't catch those errors.  Here's what I use:

<!--- i'll catch any connection errors --->
<cftry>

  <!--- i retrieve the emails --->
  <cfpop action="GetAll"
   attachmentpath="#request.Path.FileDir#attachmentpath\"
   maxrows="250"
   name="getReplies"
   password="#pwqueryName.Password#"
   server="#request.MailServer#"
   username="#pwqueryName.UserName#">

  <!--- i set an error if an invalid username and password combination is
given --->
  <cfcatch type="COM.Allaire.ColdFusion.POPAuthFailure">
        <cfset POPError="AuthFailure">
  </cfcatch>

  <!--- i set an error if the mail server cannot be reached --->
  <cfcatch type="COM.Allaire.ColdFusion.POPConnectionFailure">
        <cfset POPError="ConnectionFailure">
  </cfcatch>

  <!--- i catch an error if there are no messages --->
  <cfcatch type="Any">
        <cfset POPError="NoMessages">
  </cfcatch>

</cftry>

I then do a <cfswitch> on the output page if there's an error.  And I'm not
sure about locking <cffile> tags but if you use <cfpop action="GetAll">, it
is going to save multiple files on your server (depending on your
attachmentpath attribute.)  You can use action="GetHeadersOnly", but then
you won't retrieve the message (sarcasm alert: which isn't that important
anyway), any attachments, or the html portion of any multi-part emails...I'd
like to hear anyone's opinion's on putting <cflock>s on <cffile>s if they're
out there->

Tyler
email | [EMAIL PROTECTED]

----- Original Message -----
From: "Owen Leonard" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, January 02, 2002 1:25 PM
Subject: Re: Lock CFPOP?


> Are you checking for <cfpop>'s "special" errors such as
> "COM.Allaire.ColdFusion.POPAuthFailure" and
> "COM.Allaire.ColdFusion.POPConnectionFailure"?

No, I wasn't aware of those.  Where should I have looked to find out about
these?

> I was pulling a similar non-descriptive error and I had
> to put a <cftry> and <cfcatch> block around my <cfpop>'s to catch these
> errors...

Well, I do have <cfpop> wrapped with <cftry> and <cfcatch type="any">, but
this problem doesn't seem to get caught by cftry.  I'm not exactly sure what
that means about the mechanics of the problem.

> ...let me know if you want/need the snippet (if that's the problem)->

I would certainly be interested in seeing that.

  -- Owen

----
Athens County Library Services
http://www.athenscounty.lib.oh.us

______________________________________________________________________
Why Share?
  Dedicated Win 2000 Server � PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to