SOLVED Send mail to user when added to admin area SERVER ERR
Posted: Wed Aug 01, 2012 7:06 pm
Hi all
First of all I use CMSMS 1.10.3 and I use this UDT with event handler "UserAddPost"
http://wiki.cmsmadesimple.org/index.php ... in_Console
But it gives a server error when adding a new user to the admin panel.
I have so fare figured out that this marked out stop the server error
I tried with just for the UDT
And this gives the same error, so it seems like there is something wrong with either the "AddUserPost" event or the mailer.
But so far I had no luck fixing it.
Can any one help?
First of all I use CMSMS 1.10.3 and I use this UDT with event handler "UserAddPost"
http://wiki.cmsmadesimple.org/index.php ... in_Console
But it gives a server error when adding a new user to the admin panel.
I have so fare figured out that this marked out stop the server error
Code: Select all
if($newuser->email != "" && validate_email($newuser->email)){
$cmsmailer = $this->GetModuleInstance('CMSMailer');
$cmsmailer->AddAddress($newuser->email);
$cmsmailer->SetBody($bodytext);
$cmsmailer->IsHTML(false);
$cmsmailer->SetSubject($sitename.' User Account Information');
$cmsmailer->Send();
}
Code: Select all
$cmsmailer = $this->GetModuleInstance('CMSMailer');
$cmsmailer->AddAddress('somemail@earth.com','tester');
$cmsmailer->SetBody('<h4>This is a test message</h4>');
$cmsmailer->IsHTML(true);
$cmsmailer->SetSubject('Test message');
$cmsmailer->Send();
But so far I had no luck fixing it.
Can any one help?