techwthquestion Posted November 24, 2021 Share Posted November 24, 2021 (edited) Hello, I want to send an email template to the user. At the same time I want to list that email in email history. I tried to send email with the help of the link https://developers.whmcs.com/api-reference/sendemail/ but I am not getting any results Here is my code 'action' => 'SendEmail', // See https://developers.whmcs.com/api/authentication 'username' => 'admin', 'password' => 'password ', 'messagename' => 'Email_Temaplte_name_Herel', 'id' => '1', // i used client id here 'responsetype' => 'json', ) ) ); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($ch); curl_close($ch); Can I get some help on this ? Thanks Edited November 24, 2021 by techwthquestion 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted November 24, 2021 Share Posted November 24, 2021 What is the response given? 0 Quote Link to comment Share on other sites More sharing options...
techwthquestion Posted November 24, 2021 Author Share Posted November 24, 2021 15 minutes ago, steven99 said: What is the response given? Nothing steven. its just showing blank page. nothin in the error log as well. 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted November 24, 2021 Share Posted November 24, 2021 (edited) So just to confirm, when you print_r($response) it shows nothing? Also, are you using this within an external app or like a module in whmcs? If a module, hook, etc, use the internal API (locapi example it gives) instead as you don't need to worry about the login bits and I suspect that is the issue here. Edited November 24, 2021 by steven99 0 Quote Link to comment Share on other sites More sharing options...
developer _WHM_CS Posted November 28, 2021 Share Posted November 28, 2021 On 11/24/2021 at 1:06 AM, techwthquestion said: Hello, I want to send an email template to the user. At the same time I want to list that email in email history. I tried to send email with the help of the link https://developers.whmcs.com/api-reference/sendemail/ but I am not getting any results Here is my code 'action' => 'SendEmail', // See https://developers.whmcs.com/api/authentication 'username' => 'admin', 'password' => 'password ', 'messagename' => 'Email_Temaplte_name_Herel', 'id' => '1', // i used client id here 'responsetype' => 'json', ) ) ); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($ch); curl_close($ch); Can I get some help on this ? Thanks Hello you should add your IP to API list do you do it? 0 Quote Link to comment Share on other sites More sharing options...
techwthquestion Posted November 30, 2021 Author Share Posted November 30, 2021 (edited) On 11/28/2021 at 9:40 PM, developer _WHM_CS said: Hello you should add your IP to API list do you do it? Hello All, Able to send that with the the internal API. Edited November 30, 2021 by techwthquestion 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.