Jump to content

There is issue in sendAdminEmail


Recommended Posts

 * Created by PhpStorm.
 * User: ldl
 * Date: 2019/12/25
 * Time: 10:24 PM

try {

    $mergefields = array(
        'client_id' => 3,
        'service_id' => 330,
        'service_product' => 'This is a product',
        'service_domain' => 'sampledomain.com'

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, '../../includes/api.php');
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS,
                'action' => 'SendAdminEmail',
                // See https://developers.whmcs.com/api/authentication
                'username' => 'admin123',
                'password' => 'adminpwd',
                'messagename' => 'Dedicated/VPS Server Welcome Email',
                'mergefields' => $mergefields,//array('client_id' => 1, 'service_id' => 1, 'service_product' => 'This is a product', 'service_domain' => 'sampledomain.com'),
                'responsetype' => $responsetype,

    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

    $response = curl_exec($ch);

    echo $response;

}catch (Exception $e) {
    echo $e;

    echo '200';


You see my upper code in a `path-to-whmcs/admin/test05.php`, I follow the [API document](https://developers.whmcs.com/api-reference/sendadminemail/ 

But it send email fail, there  even echo `200`, but the `$response` is blank. there only echo `200`.


Who can tell me why there is issue in sendAdminEmail? 





Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated