Sc_url_library not working

Good morning,

Production and Dev environment use php 7.0 and built using scriptcase 9.4.031

error is: Fatal error : require_once(): Failed opening required ‘…/_lib/libraries/sys/PHPmailer5/PHPmailer/class.phpmailer.php’ (include_path=’.:/opt/cpanel/ea-php70/root/usr/share/pear’)

The phpmailer library I setup works fine in dev but when put live it cannot find the files needed. I have been forced to go into an app that uses this library and manually add a reference to it as well as copy these filed to the application directory

here is an example

//added manually
require_once DIR .’/class.phpmailer.php’;
require_once DIR .’/class.smtp.php’;
//end manual add

require_once sc_url_library(‘sys’, ‘PHPmailer5’, ‘PHPmailer/class.phpmailer.php’);

require_once sc_url_library(‘sys’, ‘PHPmailer5’, ‘PHPmailer/class.smtp.php’);

any idea what i may be doing wrong here or what I am missing?

I did try setting those two files class.phpmailer and class.smtp to full rights (777) but same result.

The files are indeed there I just don’t know why they are not working with SC_URL_LIBRARY



please note that the forum is trimming off the underscores before and after the DIR

anyone have anything here? I just can’t get this to work

I use this syntax:

sc_include_library(“prj”, “PHPMailer”, “src/PHPMailer.php”, true, true);
sc_include_library(“prj”, “PHPMailer”, “src/Exception.php”, true, true);
sc_include_library(“prj”, “PHPMailer”, “src/SMTP.php”, true, true);

this is the error I get doing it that way

Fatal error : require_once(): Failed opening required ‘…/_lib/libraries/sys/PHPMailer5/PHPmailer/class.phpmailer.php’ (include_path=’.:/opt/cpanel/ea-php70/root/usr/share/pear’) in /home/websitename/public_html/_lib/lib/php/nm_functions.php on line 200

Where do you have the PHPMailer library installed?
You have to adjust the path.
In my case, the library is installed:
:\Program Files (x86)\NetMake\V9_PHP7_3\wwwroot\scriptcase\app\My_app_name\_lib\libraries\grp\PHPMailer\src


exact code I used is:
sc_include_library(‘sys’, ‘PHPMailer5’, ‘PHPmailer/class.phpmailer.php’, true, true);
sc_include_library(‘sys’, ‘PHPMailer5’, ‘PHPmailer/class.smtp.php’, true, true);

I used these lines in my latest attempt to get this to work and essentially ignore using the scriptcase macros and I am able to get the emails to function as I would like

require_once ‘…/_lib/libraries/sys/PHPmailer5/PHPMailer/class.phpmailer.php’;
require_once ‘…/_lib/libraries/sys/PHPmailer5/PHPMailer/class.smtp.php’;

So does it work now?

yes it does. just had to stop using the script case macro and it worked with the php code from my last post