cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Command-line equivalent of PHP

From: Ben Morrise <ben_morrise_at_yahoo.com>
Date: Tue, 20 Sep 2005 12:06:56 -0700 (PDT)

I have a script here that works for what I'm doing, but I want to duplicate it from the command line and I'm not sure how to do it. Could anyone give me some ideas? Thanks
 
<?
$url = "https://www.mywebsite.com/index.html?session=8f719a219b3e40dca42564fae7a6501f";
$cookie_file_path = "cookies.txt";
$ch = curl_init();
$agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)";
curl_setopt($ch, CURLOPT_COOKIE, "session_cookie=a442e7795a20fa0820e5bc8c7f7b3734%2C62f0635dbda925cebc34f5ce3a27b739%2C3c63bb9fd2438f5d14d3425422b83bf7%2Cdf030e86d69509194c10d85c03b58f1f%2C7aa38b444b16defb43106d5eff256940");
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_DEBUG, true);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_exec($ch);
curl_close($ch);
?>

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

_______________________________________________
curl-and-php mailing list
curl-and-php_at_cool.haxx.se
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2005-09-20