cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Using Curl to Prepare Email on Local Server

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Wed, 5 Jul 2006 08:48:57 -0700

On Wed, Jul 05, 2006 at 08:25:53AM -0700, Greg Sims wrote:
> I need to make this script more robust. Two ideas come to mind:
>
> (1) check the resulting file for </html> as the last line and retry
> curl if not

You need to find out why the transfer is failing in these cases. This check
will happily allow a well-formed 404 error page to be sent to the mailing
list.

If it's a temporary network problem of some sort, you can use curl's
--retry option to attempt to download the file several times before
giving up. You can also use the --fail option to notify the script
when one of a certain class of errors is detected. In any case, you
need to check the return code in your script (errorlevel for Windows)
to see if all is well.

> (2) the 0705.php file is local to the server. Is it possible to
> use curl without going off the server (without using the network) to accomplish

A command-line PHP interpreter is available so you might be able to do this.
You still need to change your script to detect errors, no matter which
technique you end up using.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2006-07-05