Here's my code.... for reference:
Code: Select all
{if isset($smarty.post.submit)}
{cmsmailer} {* udt *}
{$cmsmailer->reset()}
{$cmsmailer->SetSubject('Test Message')}
{$cmsmailer->AddAddress('calguy1000@cmsmadesimple.org')}
{$cmsmailer->SetBody('This is a test message')}
{$cmsmailer->Send()}
Message Sent
{else}
<form name="test" method="post">
<input type="submit" name="submit" value="Send Test Message">
</form>
{/if}
First the {cmsmailer} udt is invoked which simply assigns the cmsmailer object to smarty for use in our page
Then I call the various cmsmailer methods to send an email.
This example kinds blurs the lines between programming and layout and design, but only a little bit

I'm sure you can find many uses for code like this to send messages from within your page.
Here's the code for the cmsmailer UDT:
Code: Select all
global $gCms;
$smarty =& $gCms->GetSmarty();
$cmsmailer =& $gCms->modules['CMSMailer']['object'];
$smarty->assign_by_ref('cmsmailer',$cmsmailer);