To send the email on some given date and time
Use PDO, not mysql_* as they are deprecated and dangerous.
Break up your code into functions, this makes it easier to call and test.
Throw and catch exceptions.
You can omit the ending ?>


NOTE: This is untested code as I don't have the isdk.php file.

    &lt;?php

    require('iSDK/src/isdk.php');

    $iSDK = new iSDK();

    try{
        checkConnection($iSDK);
        performQuery($iSDK, getDBConnection("", "", "", ""));
    } catch(RuntimeException $e){
        die($e-&gt;getMessage());
    }

    function checkConnection(&amp;$iSDK){
        # Throw an exception if we don't have a connection, otherwise return true
        if (!$iSDK-&gt;cfgCon("connectionName")) {
            throw new RuntimeException('Could not obtain connection.');
        }
    }

    function performQuery(&amp;$iSDK, $PDO){
        $sth = $PDO-&gt;prepare("SELECT * FROM `emails` WHERE `senddate` &lt;= NOW()");
        $sth-&gt;setFetchMode(PDO::FETCH_ASSOC); # setting the fetch mode
        $sth-&gt;execute();

        while($row = $sth-&gt;fetch()) {
            $conDat = array('Email' =&gt; $row['email']);
            $conID = $iSDK-&gt;addCon($conDat);
            $clist = array($conID);
            $email = $iSDK-&gt;sendEmail($clist, 'kamranasadi431@gmail.com', '~Contact.Email~', 'ccAddresses', 'bccAddresses', 'contentType', 'JK', 'htmlBody', 'txtBody');
        }
    }

    function getDBConnection($host, $dbname, $user, $pass){
        try {
            return new PDO("mysql:host=$host;dbname=$dbname", $user, $pass);
        } catch(PDOException $e) {
            die($e-&gt;getMessage());
        }
    }