cURL / Mailing Lists / curl-library / Single Mail

curl-library

curl-library installation

From: <woleraymond_at_enownow.com>
Date: Mon, 8 Jan 2007 03:16:08 -1200

hi,

im running Apache 2.2.2, PHP 5.1.4 on windows server 2003 for small biz server.

i tried install the curl library by removing the semicolon on the extension line in the php.ini file ,and also dumped the 2 dll files(libeay32.dll and ssleay32.dll) in to the windows/system32 directory

but while i tried to run this codes

 

&lt;?php
/*
 * AddressBookImport.com is a PHP-Yahoo gateway. It will allow you to
 * retrieve your contacts from Yahoo Server using PHP and cURL Libraries.
 *
 * Created by: AddressBookImport.com &lt;info_at_addressbookimport.com&gt;, November 01, 2005
 *
 * This program is trial version of this script. The script can be purchased at
 * www.AddressBookImport.com
 */

$sMessage = '
join me @ the new virtual community @ mydomainname.com.&lt;br&gt;
create your free custom profile with unlimited pictures,&lt;br&gt;
rate other members, message other members, watch music videos,&lt;br&gt;
listen to online radio streams and more.&lt;br&gt;
Register today FREE @ www.mydomianname.com&lt;br&gt;
';

$sSubject = "Join me at enownow.com";
$sFromEmailName = "enownow.com";
$sFromEmail = "rkomolafe_at_enownow.com";

 

?&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" id="AddressBookImport.com"&gt;
&lt;head&gt;
&lt;title&gt;Yahoo Address Book Import Script - AddressBookImport - Address Book Import Script for Yahoo, Hotmail, Gmail, AOL and more&lt;/title&gt;
&lt;meta name="keywords" content="AddressBookImport, addressbook, import, script, grabber, addressbook grabber, addressbook import script, php, curl" /&gt;
&lt;meta name="description" content="AddressBookImport - Address Book Import Script for Yahoo, Hotmail, Gmail, AOL and more" /&gt;
&lt;meta name="author" content="AddressBookImport.com" /&gt;
&lt;/head&gt;
&lt;body bgcolor=#FFFFFF leftmargin=0 topmargin=5 marginwidth=0 marginheight=0&gt;
&lt;br&gt;
&lt;h3 align=center&gt;Yahoo! AddressBookImport Script - www.AddressBookImport.com&lt;/h3&gt;&lt;hr size=1&gt;&lt;br&gt;

 &lt;table border=0 cellspacing=0 cellpadding=1 width="50%" align=center&gt;
 &lt;form method="post" action="&lt;?= $_SERVER['SCRIPT_NAME']; ?&gt;"&gt;
 &lt;tr&gt;
  &lt;td width="120"&gt;&lt;img src="http://www.AddressBookImport.com/images/invite/yahoo.gif"&gt;&lt;/td&gt;
  &lt;td&gt;Yahoo! Email Address:&lt;br /&gt;&lt;input type="text" class="form1" name="emailaddress"&gt;&lt;/td&gt;
  &lt;td&gt;Yahoo! Password:&lt;br /&gt;&lt;input type="password" class="form1" name="password"&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;input type="submit" class="form1" value="Submit"&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/form&gt;
 &lt;/table&gt;

&lt;div align=center&gt;

&lt;?php
if ($_SERVER["CONTENT_LENGTH"] &gt; 0)
{
    $sAction = fnGet("action");

    if ($sAction == "sendemails")
    {
        // Send the Email Addresses
     $num = fnGet("i");
     $sEmailAddress = fnGet("fromname");

     for ($i=0; $i &lt; $num; $i++)
     {
      $sName = fnGet("name" . $i);
      $sEmail = fnGet("email" . $i);
      $sCheck = fnGet("check" . $i);

      if ($sCheck == "on")
      {

            $headers = 'MIME-Version: 1.0' . "\r\n";
            $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

            // Additional headers
            $headers .= 'To: ' . $sName . ' &lt;' . $sEmail . '&gt;' . "\r\n";
            $headers .= 'From: ' . $sFromEmailName . ' &lt;' . $sFromEmail . '&gt;' . "\r\n";

          // Mail it
          $bMailReturn = mail($sEmail, $sSubject, $sMessage, $headers);
          if ($bMailReturn == true)
           print('Message sent to ' . $sEmail . '&lt;br&gt;');
      }
     }
    }
    else
    {
        $varURL = "http://www.AddressBookImport.com/trial/";

        $params = "service=Yahoo&amp;emailaddress=" . fnGet("emailaddress") . "&amp;password=" . fnGet("password");

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
        curl_setopt($ch, CURLOPT_URL,$varURL);
        curl_setopt($ch, CURLOPT_POST,1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
        $content = curl_exec ($ch);

        if (strpos($content, "~Invalid Login~") !== false)
        print('&lt;br&gt;&lt;br&gt;&lt;div align=center&gt;... INVALID LOGIN ...&lt;/div&gt;');
       else
       {
           print('
                &lt;form method="post" action="yahoo.php"&gt;
                &lt;div align=center&gt;&lt;br&gt;&lt;br&gt;Select the Contacts you want to send invite to:&lt;br/&gt;&lt;/div&gt;
                &lt;table border=0 cellspacing=0 cellpadding=3 width="40%" align=center&gt;');

            $content = str_replace('&lt;!-- --&gt;', '', $content);

            $sList = explode("\n", $content);

            for ($i=0; $i &lt; count($sList)-1; $i++)
            {
                $sList2 = explode(",", $sList[$i]);
                print('&lt;tr&gt;&lt;td width="10" align=center&gt;&lt;input type="checkbox" id="check' . $i . '" name="check' . $i . '" checked&gt;&lt;/td&gt;&lt;td&gt;&lt;input type="text" size="30" name="name' . $i . '" value="' . $sList2[0] . '"&gt;&lt;/td&gt;&lt;td&gt;&lt;input type="text" size="30" name="email' . $i . '" value="' . $sList2[1] . '"&gt;&lt;/td&gt;&lt;/tr&gt;');
            }

            print('
            &lt;/table&gt;
            &lt;br /&gt;&lt;br /&gt;
            &lt;div align=center&gt;&lt;input type="submit" value="Send Invite"&gt;&lt;/div&gt;
            &lt;input type="hidden" name="action" value="sendemails"&gt;
            &lt;input type="hidden" name="i" value="' . $i . '"&gt;
            &lt;input type="hidden" name="fromname" value="' . fnGet("emailaddress") . '"&gt;
            &lt;/form&gt;
            ');
        }
    }
}

function fnGet($varQuery, $varType = "AUTO")
{
    if ($varType == "AUTO")
    {
     if (isset($_GET["$varQuery"]))
        {
      return($_GET["$varQuery"]);
        }
     elseif (isset($_POST["$varQuery"]))
        {
      return($_POST["$varQuery"]);
        }
    }
    elseif ($varType == "GET")
    {
     if (isset($_GET["$varQuery"]))
        {
      return($_GET["$varQuery"]);
        }
    }
    elseif ($varType == "POST")
    {
     if (isset($_POST["$varQuery"]))
        {
      return($_POST["$varQuery"]);
        }
    }

    return("");
}

?&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;

the error i get is : Fatal error: Unknown function: curl_init() in C:\xampp\htdocs\cutenews\Yahoo.php on line 92
pls wat im i doing wrong

cheers
Received on 2007-01-08