I want to use CMSMailer in an UDT to send an e-mail. I've configured CMSMailer in the admin panel and received the test e-mail.
However, I've tested a quickly put-together UDT to test the use of CMSMailer, but I don't received the mail.
I am using this code:
Code: Select all
global $gCms;
//use CMSMailer module to send mail
$cmsmailer =& $gCms->modules['CMSMailer']['object'];
$cmsmailer->AddAddress('my@email.com',$name='My Name');
$cmsmailer->SetPriority(1);
$cmsmailer->SetFrom('sender@email.com');
$cmsmailer->SetFromName('Sender Name');
$cmsmailer->SetBody('This is the body text');
$cmsmailer->IsHTML(true);
$cmsmailer->SetSubject('This is the subject');
$cmsmailer->Send();