### Stunnel Service Installation Commands Source: https://www.rangermsp.com/wiki/KB%3A_Setting_up_Email_Connector_and_Alerts_Server_with_SSL Commands to install and start the Stunnel Windows service via Command Prompt. ```batch Stunnel.exe -install sc start Stunnel ``` -------------------------------- ### Start the new web interface service Source: https://www.rangermsp.com/wiki/KB%3A_Running_multiple_Services_on_the_same_server Use the Sc.exe command to start the service with the newly assigned unique name. ```bash Sc.exe start CRMWebInterface<**NEWNAME**> ``` -------------------------------- ### Install RangerMSP Web Interface Service Source: https://www.rangermsp.com/wiki/Web_Interface Execute this command in an Administrator command prompt on the local server to install the service. ```cmd \RangerMSP\WebInterface\CRMWebInterface.exe -install ``` -------------------------------- ### Basic RangerMSP Connection Pattern Source: https://www.rangermsp.com/wiki/VB.NET_API A complete example demonstrating initialization, error handling with Try/Catch, and termination. ```vbnet Try Dim config As New CRM.Config config.AppName = "VB.NET Demo" config.DllFolder = "C:\RangerMSP\ThirdParty\UserDev" config.DbFolder = "C:\RangerMSP\db" CRM.Application.Initialize(config) 'At this point we have successfully initialized the CRM.Application 'and can start using the other library classes Catch ex As Exception Console.Out.Write(ex.Message) Finally CRM.Application.Terminate() End Try ``` -------------------------------- ### Install CRM Server Service Manually Source: https://www.rangermsp.com/wiki/Install_Server_Service Execute this command in an elevated command prompt to install the service. Ensure the path is a local server path. ```text < Installation_DIR>\RangerMSP\Server\CRMServer.exe -install ``` -------------------------------- ### Example configuration with unique service name Source: https://www.rangermsp.com/wiki/KB%3A_Running_multiple_Services_on_the_same_server A sample configuration block showing the placement of the UniqueServiceName key alongside other server settings. ```ini [Pref] ServerPort=4961 TimeOutAmount=60 ServerIP=127.0.0.1 **UniqueServiceName=CCRMWebInterface** ``` -------------------------------- ### CmtGetRecordDataByRecId Account Response Example Source: https://www.rangermsp.com/wiki/API_Reference_Manual A successful response example containing Account data fields wrapped in CDATA tags. ```xml SUCCESS ``` -------------------------------- ### Example Passphrase Source: https://www.rangermsp.com/wiki/Password_Manager A sample passphrase demonstrating the recommended mixture of uppercase, lowercase, numbers, spaces, and punctuation. ```text The snow is White. The ocean is Blue. Welcome 2 Baloo. ``` -------------------------------- ### ODBC Database Path Configuration Source: https://www.rangermsp.com/wiki/API_Developers_Guide Example format for the database path including the server IP address and port for the Advantage Database Server. ```text \\192.168.0.1:6262\RangerMSP\Db ``` -------------------------------- ### Markdown Header Formatting Source: https://www.rangermsp.com/wiki/Special%3ASearch/%241 Example of Markdown header syntax. ```markdown #Header 1 ``` -------------------------------- ### API Constant and XML Declaration Source: https://www.rangermsp.com/wiki/Special%3ASearch/%241 Example of defining a constant and an XML declaration string in the API. ```vbnet Private Const C_Ok As Integer = 1 "" & _ ``` -------------------------------- ### XML Token Formatting Source: https://www.rangermsp.com/wiki/API_Reference_Manual Example of how to format a database field name as an XML token. ```xml 10 ``` -------------------------------- ### CmtGetFieldAttributesByRecId Response Examples Source: https://www.rangermsp.com/wiki/API_Reference_Manual Examples of successful responses for character and numeric field types. ```xml SUCCESS 30 ``` ```xml SUCCESS ``` -------------------------------- ### Initialize and Query RangerMSP Data in C# Source: https://www.rangermsp.com/wiki/CSharp_API Demonstrates the full lifecycle of a RangerMSP application session, including configuration, initialization, object querying, and termination. Ensure the DllFolder and DbFolder paths are correctly set to your local RangerMSP installation. ```csharp using System; using System.Collections.Generic; using System.Text; namespace RangerMSP_CSharp { class Program { static void Main(string[] args) { try { CRM.Config config = new CRM.Config(); config.AppName = "C# Demo"; config.DllFolder = "C:\\RangerMSP\\ThirdParty\\UserDev"; config.DbFolder = "C:\\RangerMSP\\db"; CRM.Application.Initialize(config); //At this point we have successfully initialized the CRM.Application //and can start using the other library classes CRM.ObjectQuery accountSearch = new CRM.ObjectQuery(); accountSearch.AddCriteria(CRM.Account.Fields.City, CRM.OperatorEnum.opEqual, "New York"); List accounts = accountSearch.FetchObjects(); foreach (CRM.Account account in accounts) { Console.Out.WriteLine(account.CompanyName); } } catch (CRM.Exception exc) { //here we catch RangerMSP specific error //we can inspect the RangerMSP status (exc.Status) //exc.Codes contains all error codes last call generated //here we show the error message Console.Out.Write(exc.Message); } catch (Exception exc) { Console.Out.Write(exc.Message); } finally { CRM.Application.Terminate(); } } } } ``` -------------------------------- ### CmtGetRecordDataByRecId Ticket Response Example Source: https://www.rangermsp.com/wiki/API_Reference_Manual A successful response example for a Ticket record, demonstrating raw data attributes. ```xml SUCCESS Cancelled 24/01/2011 18:03 ``` -------------------------------- ### Configure Local Server Connection Source: https://www.rangermsp.com/wiki/C%2B%2B_API Sets up the CRM::Config object for a local RangerMSP server installation. ```cpp CRM::Config config; config.AppName = "C++ Demo"; config.DllFolder = "C:\\RangerMSP\\ThirdParty\\UserDev"; config.DbFolder = "C:\\RangerMSP\\db"; ``` -------------------------------- ### Automate Web Logins via URL Source: https://www.rangermsp.com/wiki/Password_Manager Embed credentials into a URL using placeholders to automate authentication for web services that support GET parameters. ```text **https://www.samplesite.com/default.php?user=<>&pass=<>** ``` -------------------------------- ### Certificate File Path Source: https://www.rangermsp.com/wiki/Using_SSL_with_Web_Interface The required directory path for storing SSL certificate files in legacy installations. ```text \RangerMSP\WebInterface ``` -------------------------------- ### Subscription Link Templates Source: https://www.rangermsp.com/wiki/KB%3A_Managing_Group_Email_Subscriptions URL structures for triggering subscription cancellations, including generic syntax, a concrete example, and a template-ready format for mail merge. ```text http://www.YourWebServer.com/script.php?group={email_group_Tech_Rec_ID}&recid={Account_Rec_ID} ``` ```text http://127.0.0.1/script.php?group=FLDUSRCRD2Z3U98RAJNY&recid=CRDCO94HUDF8JE06KGTG ``` ```text http://127.0.0.1/script.php?group=FLDUSRCRD2Z3U98RAJNY&recid= ``` -------------------------------- ### CmtGetRecordDataByRecId Request Source: https://www.rangermsp.com/wiki/API_Reference_Manual Example request structure for retrieving specific fields of an Account record by its ID. ```xml MySoftwareName CRDC1VTHMDF627HJECG7 FLDCRDCOMPANY, FLDCRDCONTACT, FLDCRDADDRESS1, FLDCRDCITY, ``` -------------------------------- ### Troubleshoot Data Server Error Source: https://www.rangermsp.com/wiki/Backup_%26_Restore_FAQ Example of the error message displayed when a RangerMSP client cannot access the database path after a restore. ```text Procedure halted due to data server error. Verify server is operating and this computer has access to the server folder. (C:\RangerMSP\DB) ``` -------------------------------- ### Create a new account in C++ Source: https://www.rangermsp.com/wiki/C%2B%2B_API Demonstrates initializing an account object, setting its properties, and persisting the changes to the database. ```cpp CRM::Account account; account.FileAs("ACME Company"); account.Dear("Mr."); account.Contact("John Doe"); account.Save(); ``` -------------------------------- ### Create a New Account in VB.NET Source: https://www.rangermsp.com/wiki/VB.NET_API Demonstrates creating a new account entity by instantiating the class, setting properties, and calling the Save method. ```vbnet Dim account As New CRM.Account account.FileAs = "ACME Company" account.Dear = "Mr." account.Contact = "John Doe" account.Save() ``` -------------------------------- ### Create a new Account object in C# Source: https://www.rangermsp.com/wiki/CSharp_API Demonstrates initializing a new account entity, setting its properties, and persisting the changes to the database. ```csharp CRM.Account account = new CRM.Account(); account.FileAs = "ACME Company"; account.Dear = "Mr."; account.Contact = "John Doe"; account.Save(); ``` -------------------------------- ### Create a tip box Source: https://www.rangermsp.com/wiki/Help%3AEditing A table-based layout for displaying tips or highlighted information. ```wikitext {| id="mp-tfp" style="margin:7px 0 0 0; width:100%; background:none;" | class="MainPageBG" style="width:50%; border:1px solid #FFCB99; background:#ffffff; vertical-align:top; color:#000;" | {| id="mp-left" cellpadding="2" cellspacing="5" style="width:100%; vertical-align:top; background:#ffffff;" !

Tip

|- | style="color:#000;" |
TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT
|} |} ``` -------------------------------- ### C++ RangerMSP Database Integration Source: https://www.rangermsp.com/wiki/API_Code_Samples Demonstrates initializing the database engine, inserting a new account record, and updating an existing record. Ensure the CmtDBEng.h header is included and the library is properly linked. ```cpp // Demo.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "CmtDBEng.h" #include #include int ErrCodesParsing (char* ErrCodeBuff) { // Demo.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "CmtDBEng.h" #include #include int ErrCodesParsing (char* ErrCodeBuff) { const int C_DescSize = 1024; char desc[C_DescSize]; char Delimiter[] = "\n"; int Code; char* pch; pch = strtok (ErrCodeBuff,Delimiter); while (pch != NULL) { Code = atoi(pch); CmtGetDescriptionByCode(Code, C_DescSize, desc); printf ("%s\n",desc); pch = strtok (NULL, Delimiter); } return 0; } int main(int argc, char* argv[]) { const int C_DataBuffSize = 1024; const int C_MapBufSize = 1024; const int C_ErrMsgBuffSize = 1024; const int C_ErrCodeBuffSize = 64; const int C_RecIDBuffSize = 64; const int C_Flag = 1; const int C_Ok = 1; const int C_AccountsTable = 10; const int C_ExampleCode = 54000; int Status; char DataBuff[C_DataBuffSize] = ""; char MapBuff[C_MapBufSize] = ""; char RecIdBuff[C_RecIDBuffSize]; char ErrCodesBuff[C_ErrCodeBuffSize]; char ErrMsgBuff[C_ErrMsgBuffSize]; char* C_AppName = "Demo"; //* Establishing connection with RangerMSP, Should be called only once for the entire session ** CmtInitDbEngDll(C_AppName, // Your application name. This will be used for all functions of the // package. // Specify a meaningful value. "C:\\Demo\\DB\\", //Path to the database folder where RangerMSP the server is // installed \\RangerMSP\\Db &Status); //Returned connection status if (Status == C_Ok) { //***Insert New Account into that Accounts table ******************* strcpy (DataBuff,"'Bart De Hantsetters','De Hantsetters','Hantsetters'"); strcat (MapBuff, "'\n,\nFLDCRDFULLNAME\nFLDCRDDEAR\nFLDCRDCONTACT"); strcat (RecIdBuff, ""); strcat (ErrCodesBuff, ""); strcat (ErrMsgBuff, ""); CmtInsUpdRec(C_AppName, //String for your selection. C_AccountsTable, //Desired Table Code DataBuff, //This string contains the values which we want to add to the database MapBuff, //List of database fields where we want to add data C_Flag,//Flag - stop(0) continue(1) the input process is data //value(s) is invalid 0, //Not used C_RecIDBuffSize, //Length of REC ID Buffer C_ErrCodeBuffSize, //Length of Error Code Buffer C_ErrMsgBuffSize, //Length of Error Message Buffer RecIdBuff, //Buffer for returned REC ID ErrCodesBuff, //Buffer for returned Error Codes ErrMsgBuff, //Bufer for returned Error Messages &Status //Returned status ); if (ErrMsgBuff == "") printf("Error Message: %s", ErrMsgBuff); ErrCodesParsing(ErrCodesBuff); if (Status == C_Ok) { //***** Updating the Account record we've just created ************* strcpy (MapBuff, "'\n,\nFLDCRDDEAR\nFLDCRDRECID"); // Map file for the update // transaction - the Dear field and the record id strcpy (DataBuff,"'Doctor','"); strcat (DataBuff, RecIdBuff); strcat (DataBuff, "'"); strcat (ErrCodesBuff, ""); strcat (ErrMsgBuff, ""); CmtInsUpdRec(C_AppName, // string for your selection. C_AccountsTable, // Desired Table Code DataBuff, // string contains the values, which we want to add into the Database MapBuff, // list of the Database Fields in which we want to add data C_Flag, // Flag - stop(0)/continue(1) the input process is some data // value(s) is invalid 0, // Not used C_RecIDBuffSize, // length of RecID Buffer C_ErrCodeBuffSize, // length of Error Code Buffer C_ErrMsgBuffSize, // length of Error Message Buffer RecIdBuff, // buffer for returned RecID ErrCodesBuff, // buffer for returned Error Codes ErrMsgBuff, // bufer for returned Error Messages &Status // returned status ); if (ErrMsgBuff == "") printf("Error Message: %s", ErrMsgBuff); ErrCodesParsing(ErrCodesBuff); } else { printf("Insert new Account. Error code: %d\n", Status); }; //****Terminate connection with RangerMSP******************* CmtTerminateDbEngDll(); } else { printf("RangerMSP Init failed. Error code: %d\n", Status); }; return 0; } ``` -------------------------------- ### Initialize and Interact with RangerMSP via Delphi Source: https://www.rangermsp.com/wiki/API_Code_Samples This sample defines the external procedures for the CmtDbEng.DLL library and demonstrates how to initialize a session and prepare data for record insertion. ```Delphi program Demo; {$APPTYPE CONSOLE} uses SysUtils, Classes; const C_DataBuffSize = 1024; C_MapBufSize = 1024; C_ErrMsgBuffSize = 1024; C_DescSize = 1024; C_ErrCodeBuffSize = 64; C_RecIDBuffSize = 64; C_Flag = 1; C_Ok = 1; C_AccountsTable = 10; C_AppName = 'Demo'; CmtDbEngDll = 'CmtDbEng.DLL'; var Status: integer; DataBuff: array [0..C_DataBuffSize] of Char; MapBuff: array [0..C_MapBufSize] of Char; RecIdBuff: array [0..C_RecIDBuffSize] of Char; ErrCodesBuff: array [0..C_ErrCodeBuffSize] of Char; ErrMsgBuff: array [0..C_ErrMsgBuffSize] of Char; s: string; //** Establishing connection with RangerMSP, Should be called only once for the entire session * Procedure CmtInitDbEngDll ( xSoftWareName  : PChar; // Your application name. Once selected this string // will be used for all // functions of the package. Specify a meaningful value. xDbPath  : PChar; // Path to the DB folder under where RangerMSP server is // installed \RangerMSP\Db var xvStatus  : integer // Returned connection status ); stdcall; external CmtDbEngDll; //**** Insert/Update record Procedure CmtInsUpdRec( xSoftWareName  : pChar; // See above xDataKind  : integer; // Desired Table Code xDataBuff  : pChar; // String containing the values, which we want // to add into the Database xMapBuff  : pChar; // List of the database fields into //which we want to add data xContWhenInvalidData : Integer; //Flag - stop(0)/continue(1) the input process // is some data value(s) is invalid xFlags  : Integer; // Not used xRecIDBuffLen  : Integer; // Length of REC ID Buffer xLogErrCodesBuffLen  : Integer; // Length of Error Code Buffer xLogErrMsgBuffLen  : Integer; // Length of Error Message Buffer xvRecIDBuff  : pChar; // Buffer for returned REC ID xvErrCodesLogBuff : pChar; // Buffer for returned Error Codes xvErrMsgLogBuff  : pChar; // Buffer for returned Error Messages var xvStatus  : Integer // Returned status ); stdcall; external CmtDbEngDll; //**** Terminate connection with RangerMSP **** procedure CmtTerminateDbEngDll; stdcall; external CmtDbEngDll; procedure CmtGetDescriptionByCode( xCode  : Integer; xDescLen  : Integer; xvDesc  : pChar); stdcall; external CmtDbEngDll; procedure CmtGetDescriptionByStatus( xCode  : Integer; xDescLen  : Integer; xvDesc  : pChar); stdcall; external CmtDbEngDll; procedure ErrCodesParsing (ErrCodeBuff: string); var lList: TStringList; i: integer; aDescErrCode : Pchar; begin try lList := TStringList.Create; lList.Text := ErrCodeBuff; GetMem(aDescErrCode,C_DescSize); for i := 0 to lList.Count - 1 do begin CmtGetDescriptionByCode(StrToInt(lList[i]), C_DescSize, aDescErrCode); writeln('Error Code: '+lList[i]+' Desc: '+string(aDescErrCode)); end; finally FreeMem(aDescErrCode); lList.Destroy; end; end; procedure DisplayErrStatusCode(xCode : Integer); var aStatusErrCode : Pchar; begin try GetMem(aStatusErrCode,C_DescSize); CmtGetDescriptionByStatus(xCode,C_DescSize, aStatusErrCode); writeln('RangerMSP Init failed. Error code: '+Inttostr(xCode)+' Desc: '+string(aStatusErrCode)); finally FreeMem(aStatusErrCode); end; end; begin //**** Establishing connection with RangerMSP, Should be called only once for the entire session CmtInitDbEngDll(C_AppName, // Your application name. Once selected this string will be used // for all functions of the package. Specify a meaningful value. 'C:\DemoDelphi\db\', // Path to the DB folder under where RangerMSP server is // installed \RangerMSP\Db Status // Returned connection status ); if Status = C_Ok then begin //**** Insert a new Account into the Accounts table **** s := '"Bart De Hantsetters","De Hantsetters","Hantsetters"'; StrPCopy(DataBuff, s); s := '"'+#13','+#13+'FLDCRDFULLNAME'+#13+'FLDCRDDEAR'+#13+'FLDCRDCONTACT'+#0; StrPCopy(MapBuff, s); ``` -------------------------------- ### Initialize and Update Account via Python Source: https://www.rangermsp.com/wiki/API_Code_Samples Uses the CRMLib library to initialize a database connection, search for an account, and perform an update or creation operation. Requires the RangerMSP environment to be correctly configured with valid paths to the DLL and database folders. ```python import clr from System import String, Char, Int32 CRMLib = clr.AddReference(R'\\RangerMSP\ThirdParty\UserDev\CRMLib.dll') import CRM MSP = CRM.Application MSPConfig = CRM.Config() MSPConfig.AppName = "CRMAgent" MSPConfig.DllFolder = R"\\RangerMSP\ThirdParty\UserDev" MSPConfig.DbFolder = R"\\RangerMSP\Db" MSP.Initialize(MSPConfig) print(f"Database initialized: {MSP.instance().initialized_}") # Search account by name, the list has to be initialized before using it. accountlist=[] accountSearch = CRM.ObjectQuery[CRM.Account]() accountSearch.AddCriteria(CRM.Account.Fields.FileAs, CRM.OperatorEnum.opEqual, 'ACME Cool Company') accountlist=accountSearch.FetchObjects() # Display results print (f"Number of accounts: {len(accountlist)}") for x in range(len(accountlist)): print (f"Found REC_ID: {accountlist[x].AccountREC_ID}") # If we find exactly one record then we update it (otherwise a new record is created) if (len(accountlist) == 1): account = CRM.Account(accountlist[0].AccountREC_ID) else: account = CRM.Account() account.FileAs = "ACME Cool Company" account.Dear = "Mr." account.Contact = "Johnny Doe" account.Save() RecID = account.AccountREC_ID print (f"Updated: {RecID}") # Close Database connection MSP.Terminate() print(f"Database initialized: {MSP.instance().initialized_}") ``` -------------------------------- ### Initialize and Query RangerMSP in VB.NET Source: https://www.rangermsp.com/wiki/VB.NET_API Demonstrates the full lifecycle of a RangerMSP application session, including configuration, initialization, data retrieval, and cleanup. ```vbnet Module Module1 Sub Main() Try 'Setup the CRM.Config object Dim config As New CRM.Config config.AppName = "VB.NET Demo" config.DllFolder = "C:\RangerMSP\ThirdParty\UserDev" config.DbFolder = "C:\RangerMSP\db" 'Initialize the CRM.Application CRM.Application.Initialize(config) 'At this point we have successfully initialized the CRM.Application 'and can start using the other library classes 'search for "New York" in the FLDCRDCITY field Dim accountSearch As New CRM.ObjectQuery(Of CRM.Account) accountSearch.AddCriteria("FLDCRDCITY", CRM.OperatorEnum.opEqual, "New York") Dim accounts As List(Of CRM.Account) = accountSearch.FetchObjects() 'loop through the retrieved accounts and output the CompanyName For Each account In accounts Console.Out.WriteLine(account.CompanyName) Next Catch ex As CRM.Exception 'here we catch RangerMSP specific error 'we can inspect the RangerMSP status (exc.Status) 'exc.Codes contains all error codes last call generated 'here we show the error message Console.Out.Write(ex.Message) Catch ex As Exception Console.Out.Write(ex.Message) Finally CRM.Application.Terminate() End Try End Sub End Module ``` -------------------------------- ### Initialize and Query RangerMSP Objects Source: https://www.rangermsp.com/wiki/C%2B%2B_API Demonstrates the full lifecycle of a RangerMSP application session, including configuration, object retrieval, and proper termination. ```cpp #include "stdafx.h" #include #include #include #include #include #include #include #include #include #include int _tmain(int argc, _TCHAR* argv[]) { try { CRM::Config config; config.AppName = "C++ Demo"; config.DllFolder = "C:\\RangerMSP\\ThirdParty\\UserDev"; config.DbFolder = "C:\\RangerMSP\\db"; CRM::Application::Initialize(config); //At this point we have successfully initialized the RangerMSP.Application //and can start using the other library classes CRM::ObjectQuery accountSearch; accountSearch.AddCriteria(CRM::Account::Fields::City, CRM::opEqual, "New York"); CRM::ObjectQuery::COLLECTION accounts = accountSearch.FetchObjects(); CRM::ObjectQuery::COLLECTION::iterator itAccount = accounts.begin(); while (itAccount != accounts.end()) { std::cout << account.CompanyName() << "\r\n"; ++itAccount; } } catch (CRM::Exception exc) { //we can inspect the RangerMSP status (exc.Status) //refer to Error Codes Description //exc.Codes contains all error codes last call generated //also refer to Error Codes Description std::cerr << exc.error() << std::endl; } //Terminate connection with RangerMSP CRM::Application::Terminate(); return 0; } ``` -------------------------------- ### Basic RangerMSP Connection Pattern Source: https://www.rangermsp.com/wiki/CSharp_API Demonstrates the standard try-catch-finally pattern for initializing and terminating the application. ```csharp try { CRM.Config config = new CRM.Config(); config.AppName = "C# Demo"; config.DllFolder = "C:\\RangerMSP\\ThirdParty\\UserDev"; config.DbFolder = "C:\\RangerMSP\\db"; CRM.Application.Initialize(config); //At this point we have successfully initialized the CRM.Application //and can start using the other library classes } catch (CRM.Exception exc) { Console.Out.Write(exc.Message); } finally { CRM.Application.Terminate(); } ``` -------------------------------- ### Execute System Commands via URL Field Source: https://www.rangermsp.com/wiki/Password_Manager Use the cmd:// prefix to execute local system commands or launch applications. Placeholders like <> and <> are automatically replaced with stored values. ```text **cmd://C:\Windows\Notepad.exe C:\Documents\SampleFile.txt** ``` ```text **cmd://”C:\My Programs\Notepad.exe” “C:\My Documents\SampleFile.txt”** ``` ```text **cmd://c:\saved-rdp-settings\Server1.rdp** ``` ```text **cmd://C:\PuTTY\PUTTY.EXE -load "saved-session-name" -l <> -pw <>** ``` -------------------------------- ### PHP XML Processor Script Source: https://www.rangermsp.com/wiki/KB%3A_Using_PHP_To_Automatically_Generate_and_Email_XML_Transactions_to_Email_Connector This script processes POST data from a web form, constructs an XML payload, and sends it via email. Ensure PHP5 is installed and update the configuration section with your specific email and API credentials. ```php WebsiteSignup ' . $readdress . ' ' . $apipasswd . ' WebForm - New Account ACCOUNT ' . $company . ' ' . $contact . ' ' . $phone . ' ' . $email . ' '; mail($email_to, $subject, $xml, $header); ?> ``` -------------------------------- ### CmtInitDbQryDll Source: https://www.rangermsp.com/wiki/API_Reference_Manual Establishes a connection to the RangerMSP database. ```APIDOC ## CmtInitDbQryDll(app_name, path, status) ### Description Establishes a connection to the database. The app_name is used to identify the application performing changes, and the path points to the RangerMSP database folder. ### Parameters - **app_name** (string) - Required - Name of the application performing the changes. - **path** (string) - Required - Path to the DB folder where the RangerMSP server is installed. - **status** (int) - Required - Status indicator (1 for success). ``` -------------------------------- ### Initialize RangerMSP Application Source: https://www.rangermsp.com/wiki/C%2B%2B_API Initializes the application using the configured settings; must be called once before other library methods. ```cpp //RangerMSP.Application.Initialize must be the first call before invoking any other RangerMSP library method //and it should be done only once in the program's lifetime. CRM::Application::Initialize(config); ``` -------------------------------- ### CmtInitDbEngDll Source: https://www.rangermsp.com/wiki/API_Reference_Manual Establishes a connection to the RangerMSP database. ```APIDOC ## CmtInitDbEngDll(app_name, path, status) ### Description Establishes a connection to the database. The app_name is used to identify the application performing the changes. ### Parameters - **app_name** (string) - Required - Name of the application performing the changes. - **path** (string) - Required - The path to the DB folder where the RangerMSP server is installed. - **status** (int) - Required - Returns 1 for success, or other values for errors. ``` -------------------------------- ### Create a multi-column layout Source: https://www.rangermsp.com/wiki/Template%3ANavbar Use the col, break, and colend tags to organize content into multiple columns. ```wikitext {{col}} ====headline1==== text text text ====headline2==== text text text {{break}} ====headline3==== text text text {{colend}} ``` -------------------------------- ### Configure Database Field Truncation Source: https://www.rangermsp.com/wiki/C%2B%2B_API Demonstrates how to initialize the CRM application and enable exception raising for database field truncation. ```cpp RangerMSP.Config config; config.AppName = "C++ Demo"; config.DllFolder = "C:\\RangerMSP\\ThirdParty\\UserDev"; config.DbFolder = "C:\\RangerMSP\\db"; config.RaiseExceptionIfDatabaseFieldTruncated = true;//the setting is ON now //Initialize the CRM::Application CRM::Application::Initialize(config); CRM::Account account; account.FileAs("ACME Company"); account.Dear("Mr."); account.Contact("John Doe"); //the following line of code will throw an exception because we try to assign more than 40 chars to AddressLine1 account.AddressLine1("More than forty characters of the main address line");//Exception is thrown here account.Save(); ``` -------------------------------- ### Initialize RangerMSP Application Source: https://www.rangermsp.com/wiki/VB.NET_API Initializes the CRM.Application object with configuration settings. This must be the first call and performed only once. ```vbnet 'CRM.Application.Initialize must be the first call before invoking any other RangerMSP library method 'and it should be done only once in the program's lifetime. CRM.Application.Initialize(config) ``` -------------------------------- ### Retrieve Ticket Charges and Details in VBA Source: https://www.rangermsp.com/wiki/API_Code_Samples Demonstrates the workflow of initializing the database connection, querying charges for a specific ticket, and iterating through charge records to retrieve their details. Ensure constants like C_TktDataBuffSize and C_ChargeDataBuffSize are defined before execution. ```VBA Public Sub DbQry() Dim nStatus As Integer Dim aTktXMLResponseDataBuff As String * C_TktDataBuffSize Dim aChargeXMLResponseDataBuff As String * C_ChargeDataBuffSize Dim aErrorDescSize As String * C_ErrorDescSize Dim aChargesRecIdStr As String Dim aCurChargeRecIdStr As String Rem **** Establishing connection with RangerMSP, Should be called only once for the entire session ****** Call CmtInitDbQryDll(C_AppName, "c:\DemoVBA\DB\", nStatus) If nStatus <> C_Ok Then Call CmtGetDescriptionByStatus(nStatus, C_ErrorDescSize, aErrorDescSize) MsgBox ("RangerMSP Init failed. Status Error code: " & nStatus & CHR(13) & CHR(10) & aErrorDescSize ) Else rem *** ADD YOUR CODE HERE (replace the line below this section): rem *** Change the ticket ID below to fit a real ticket in your database. aRequestXml = GetChargesRecIdOfTkRequstXml("TKTVHIUTGO5KGUUCB4SL") Call CmtGetQueryRecIds(aRequestXml, Len(aRequestXml), aTktXMLResponseDataBuff, C_TktDataBuffSize, nStatus) If nStatus <> C_Ok Then MsgBox (aTktXMLResponseDataBuff) Call CmtGetDescriptionByStatus(nStatus, C_ErrorDescSize, aErrorDescSize) MsgBox ("Failed. Status Error : " & nStatus & CHR(13) & CHR(10) & aErrorDescSize ) rem *** ADD YOUR CODE HERE: rem *** parse the XML Buffer -> aTktXMLResponseDataBuff. Extract the error code that was returned from the api*** rem *** Call CmtGetDescriptionByCode(ErrorCodeFromXml, C_ErrorDescSize, aErrorDescSize) rem *** MsgBox ("Failed. XML Error : " & ErrorCodeFromXml & CHR(13) & CHR(10) & aErrorDescSize ) Else MsgBox (aTktXMLResponseDataBuff) rem **** ADD YOUR CODE HERE (replace the line below this section): rem **** parse the XML Buffer(extract the charge(s) recid of the ticket) -> aTktXMLResponseDataBuff **** rem **** The aChargesRecIdStr vairable contain the Charges recid that were extracted from the XML buffer aChargesRecIdStr = "SLPXBV3YB7F9F2DPGDC5SLPLORCIOPWYP5VW4NWASLPFYKGUNYT8E3NE23XU" Do while (Len(aChargesRecIdStr)> 0 ) aCurChargeRecIdStr = Left(aChargesRecIdStr, C_REC_ID_LEN) aChargesRecIdStr = Right(aChargesRecIdStr, Len(aChargesRecIdStr) - C_REC_ID_LEN) aRequestXml = GetChargeRecDataReqXml(aCurChargeRecIdStr) Call CmtGetRecordDataByRecId(aRequestXml, Len(aRequestXml), aChargeXMLResponseDataBuff, C_ChargeDataBuffSize, nStatus) If nStatus <> C_Ok Then MsgBox (aChargeXMLResponseDataBuff ) Call CmtGetDescriptionByStatus(nStatus, C_ErrorDescSize, aErrorDescSize) MsgBox ("Failed. Status Error : " & nStatus & CHR(13) & CHR(10) & aErrorDescSize ) rem *** ADD YOUR CODE HERE: rem *** parse the XML Buffer -> aChargeXMLResponseDataBuff. Extract the error code that was return from the api*** rem *** Call CmtGetDescriptionByCode(nStatus,C_ErrorDescSize, aErrorDescSize) rem *** MsgBox ("Failed. XML Error : " & ErrorCodeFromXml & CHR(13) & CHR(10) & aErrorDescSize ) Else MsgBox (aChargeXMLResponseDataBuff) rem **** ADD YOUR CODE HERE: parse the XML Buffer(extract the charge info) -> aChargeXMLResponseDataBuff **** End If loop End If End If Call CmtTerminateDbQryDll End Sub ``` -------------------------------- ### Create definition lists Source: https://www.rangermsp.com/wiki/Help%3AEditing Use semicolons for terms and colons for definitions. ```wikitext ;item 1 :definition 1 ;item 2 :definition 2-1 :definition 2-2 ``` -------------------------------- ### Create unordered lists with indentation Source: https://www.rangermsp.com/wiki/Markdown_Formatting_Help Use asterisks for list items and four leading spaces to create nested sub-items. ```markdown * List Item1 * List Item2 * Item intended using 4 leading spaces * This item is also intended * List Item3 ``` -------------------------------- ### CRM.Application.Initialize(Config c) Source: https://www.rangermsp.com/wiki/CSharp_API Initializes the internal RangerMSP API DLLs. This must be the first call made before using any other library functions. ```APIDOC ## CRM.Application.Initialize(Config c) ### Description Initializes the internal RangerMSP API DLLs. Must be the first call before using any other RangerMSP library calls. ### Method public static void Initialize(Config c) ### Parameters - **c** (Config) - The configuration object required for initialization. ``` -------------------------------- ### Initialize RangerMSP Application Source: https://www.rangermsp.com/wiki/C%2B%2B_API Configures and initializes the RangerMSP application environment. Ensure paths to the DLL and database folders are correct before calling Initialize. ```cpp try { CRM::Config config; config.AppName = "C++ Demo"; config.DllFolder = "C:\\RangerMSP\\ThirdParty\\UserDev"; config.DbFolder = "C:\\RangerMSP\\db"; CRM::Application::Initialize(config); //At this point we have successfully initialized the RangerMSP.Application //and can start using the other library classes } catch (CRM::Exception exc) { std::cerr << exc.error() << std::endl; } CRM::Application::Terminate(); ``` -------------------------------- ### Configure CRM.Config for Local Server Source: https://www.rangermsp.com/wiki/VB.NET_API Sets up the configuration object for a local RangerMSP server connection using file paths. ```vbnet Dim config As New CRM.Config config.AppName = "VB.NET Demo" config.DllFolder = "C:\RangerMSP\ThirdParty\UserDev" config.DbFolder = "C:\RangerMSP\db" ``` -------------------------------- ### Create a multi-column list Source: https://www.rangermsp.com/wiki/Template%3ANavbar Use the Col list tag followed by the number of columns and the list items to display content in a grid format. ```wikitext {{Col list|2| * 1 * 2 * 3 * 4 * 5 * 6 }} ``` -------------------------------- ### Configure Email Connector Settings Source: https://www.rangermsp.com/wiki/KB%3A_Setting_up_Email_Connector_and_Alerts_Server_with_SSL Settings for the Email Connector tab to connect to the POP3 server via the local Stunnel proxy. ```text Public Email Address: Your Public Email Address POP3 server: 127.0.0.1 POP3 port: 1109 Username: Use your regular username Password: Use your regular password ``` -------------------------------- ### Stunnel Configuration Template Source: https://www.rangermsp.com/wiki/KB%3A_Setting_up_Email_Connector_and_Alerts_Server_with_SSL Template for the Stunnel.Conf file. Replace placeholders with your specific mail server addresses. ```text client = yes [pop3s] accept = 127.0.0.1:1109 connect = :995 [smtps] accept = 127.0.0.1:259 connect = :465 protocol = smtp ``` ```text client = yes [pop3s] accept = 127.0.0.1:1109 connect = pop.gmail.com:995 [smtps] accept = 127.0.0.1:259 connect = smtp.gmail.com:465 protocol = smtp ``` -------------------------------- ### Configure ADS.ini Server Locator Source: https://www.rangermsp.com/wiki/SQL_Database_Troubleshooting Add server hostname or IP references to the ADS.ini file to assist with server discovery. Restart the Advantage service after making changes. ```ini [192.168.0.1] LAN_IP=192.168.0.1 LAN_PORT=2001 [Your-Server-Name] LAN_IP=192.168.0.1 LAN_PORT=2001 ``` -------------------------------- ### Initialize GFI MAX API Key Source: https://www.rangermsp.com/wiki/GFI_MAX_Link Set the API key in the configuration file to enable communication between RangerMSP and GFI MAX. ```ini GFIMAX_API_KEY= ``` -------------------------------- ### Execute Object Search Source: https://www.rangermsp.com/wiki/VB.NET_API Fetches objects matching the defined criteria into a list. ```vbnet Dim accounts As List(Of CRM.Account) = accountSearch.FetchObjects() ``` -------------------------------- ### Execute Object Query Source: https://www.rangermsp.com/wiki/C%2B%2B_API Fetches a collection of objects matching the defined criteria. ```cpp CRM::ObjectQuery::COLLECTION accounts = accountSearch.FetchObjects(); ```