Page 1 of 1

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

Posted: Tue Aug 01, 2006 9:33 am
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();

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

Posted: Tue Aug 01, 2006 9:42 am
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.