public function SendEmailToDataExtension($emailID, $sendableDataExtensionCustomerKey, $sendClassficationCustomerKey)
    {
        $email = new ET_Email_SendDefinition();
        $email->props = array("Name"=>uniqid(), "CustomerKey"=>uniqid(), "Description"=>"Created with FuelSDK");
        $email->props["SendClassification"] = array("CustomerKey"=> $sendClassficationCustomerKey);
        $email->props["SendDefinitionList"] = array("CustomerKey"=> $sendableDataExtensionCustomerKey, "DataSourceTypeID"=>"CustomObject");
        $email->props["Email"] = array("ID"=>$emailID);
        $email->authStub = $this;
        $result = $email->post();
        if ($result->status) {
            $sendresult = $email->send();
            if ($sendresult->status) {
                $deleteresult = $email->delete();
                return $sendresult;
            } else {
                throw new Exception("Unable to send using send definition due to:".print_r($result, true));
            }
        } else {
            throw new Exception("Unable to create send definition due to: ".print_r($result, true));
        }
    }
public function SendEmailToDataExtension($emailID, $sendableDataExtensionCustomerKey, $sendClassficationCustomerKey)
    {
        $email = new ET_Email_SendDefinition();
        $email->props = array("Name"=>uniqid(), "CustomerKey"=>uniqid(), "Description"=>"Created with FuelSDK");
        $email->props["SendClassification"] = array("CustomerKey"=> $sendClassficationCustomerKey);
        $email->props["SendDefinitionList"] = array("CustomerKey"=> $sendableDataExtensionCustomerKey, "DataSourceTypeID"=>"CustomObject");
        $email->props["Email"] = array("ID"=>$emailID);
        $email->authStub = $this;
        $result = $email->post();
        if ($result->status) {
            $sendresult = $email->send();
            if ($sendresult->status) {
                $deleteresult = $email->delete();
                return $sendresult;
            } else {
                throw new Exception("Unable to send using send definition due to:".print_r($result, true));
            }
        } else {
            throw new Exception("Unable to create send definition due to: ".print_r($result, true));
        }
    }
public function SendEmailToDataExtension ( $ emailID , $ sendableDataExtensionCustomerKey , $ sendClassficationCustomerKey ) { $ email = new ET_Email_SendDefinition ( ) ; $ email -> props = array ( "Name" => uniqid ( ) , "CustomerKey" => uniqid ( ) , "Description" => "Created with FuelSDK" ) ; $ email -> props [ "SendClassification" ] = array ( "CustomerKey" => $ sendClassficationCustomerKey ) ; $ email -> props [ "SendDefinitionList" ] = array ( "CustomerKey" => $ sendableDataExtensionCustomerKey , "DataSourceTypeID" => "CustomObject" ) ; $ email -> props [ "Email" ] = array ( "ID" => $ emailID ) ; $ email -> authStub = $ this ; $ result = $ email -> post ( ) ; if ( $ result -> status ) { $ sendresult = $ email -> send ( ) ; if ( $ sendresult -> status ) { $ deleteresult = $ email -> delete ( ) ; return $ sendresult ; } else { throw new Exception ( "Unable to send using send definition due to:" . print_r ( $ result , true ) ) ; } } else { throw new Exception ( "Unable to create send definition due to: " . print_r ( $ result , true ) ) ; } }
Create an email send definition, send the email based on the definition and delete the definition.

@param string $emailID Email identifier for which the email is sent
@param string $sendableDataExtensionCustomerKey Sendable data extension customer key
@param string $sendClassficationCustomerKey Send classification customer key
@return mixed Final delete action result
Create an email send definition send the email based on the definition and delete the definition .