• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

RESOLVED Importing PHP modules

DavidW

New member
Messages
1
Likes
0
Points
1
#1
I use PHPMailer to generate e-mail from the PHP code on my site. The following line worked fine under the old [php_insert] model but crashes and burns in a snipped:

require 'PHPMailerAutoload.php';

How do I make use of existing PHP modules within my PHP code while using snippets?

Thanks in advance.
 

Kirill

Support team
Messages
82
Likes
4
Points
8
#2
Hi David

Try to use the full path to the php file.
The following constants may be useful to you.

ABSPATH - root directory of site
WP_PLUGIN_DIR - wp-content/plugins

Example. If you file is in the root wordpress directory.
Code:
require ABSPATH. 'PHPMailerAutoload.php';
Best regards, Kirill
Webcraftic team