user defined extensions - 'invalid code entered' - help!

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
scotch33
Dev Team Member
Dev Team Member
Posts: 285
Joined: Tue Feb 14, 2006 9:56 pm

user defined extensions - 'invalid code entered' - help!

Post by scotch33 »

Hi,

I am trying to get phpmailer to work as a user defined extension by converting the code I use in standard PHP pages.  The code I am adding as an extensio is below.  However, i am getting an 'invalid code entered' result when i try to add this as an extension.  This is the first time I have tried a user defined extension and I thought one just added the code as one would in a normal php page.  What am I doing wrong?

Thanks!

$msg =  "This is a test. \n";

// Grab our config settings
require_once('http://www.game-solutions.com/config.php');

// Grab the FreakMailer class
require_once('http://www.game-solutions.com/lib/MailClass.inc');

// instantiate the class
$mailer = new FreakMailer();

// Set the subject
$mailer->Subject = 'Message from website.';

//set who the mail is from
$mailer->FromName = $_POST[name];
$mailer->From = $_POST[email];

// Body
$body = $msg . "\n";

$mailer->Body = $body;

// Add an address to send to.
$mailer->AddAddress('jon@jon-d-scotcher.co.uk', 'Game Solutions);

if(!$mailer->Send())
{
  echo 'There has been a problem with our mail server.  Please try again later.  We apologise for any inconvenience.  Alternatively please feel free to call us.';
}
else
{
  echo 'Thanks!  We will get back to you shortly. ';
}
$mailer->ClearAddresses();
$mailer->ClearAttachments();
cyberman

Re: user defined extensions - 'invalid code entered' - help!

Post by cyberman »

scotch33 wrote: I am trying to get phpmailer to work as a user defined extension by converting the code I use in standard PHP pages.
Perhaps you should try cmsmailer module

http://dev.cmsmadesimple.org/projects/cmsmailer/

It's a wrapper for phpmailer inside CMSms and has a docu too.
Post Reply

Return to “CMSMS Core”