NAME
AxKit::XSP::Sendmail - Simple SMTP mailer tag library for AxKit eXtesible Server Pages.
SYNOPSIS
Add the sendmail: namespace to your XSP <xsp:page
> tag:
<xsp:page
language="Perl"
xmlns:xsp="http://apache.org/xsp/core/v1"
xmlns:sendmail="http://axkit.org/NS/xsp/sendmail/v1"
>
And add this taglib to AxKit (via httpd.conf or .htaccess):
AxAddXSPTaglib AxKit::XSP::Sendmail
DESCRIPTION
The XSP sendmail: taglib adds a simple SMTP mailer to XSP via Milivoj Ivkovic's platform-neutral Mail::Sendmail module. In addition, all email addresses are validated before sending using Maurice Aubrey's Email::Valid package. This taglib is identical to the Cocoon taglib of the same name, albeit in a different namespace..
Tag Reference
<sendmail:send-mail
>
This is the required 'wrapper' element for the sendmail taglib branch.
<sendmail:smtphost
>
The this element sets the outgoing SMTP server for the current message. If ommitted, the default set in Mail::Sendmail's %mailcfg hash will be used instead.
<sendmail:from
>
Defines the 'From' field in the outgoing message. If ommited, this field defaults to value set in Mail::Sendmail's %mailcfg hash. Run perldoc Mall:Sendmail
for more detail.
<sendmail:to
>
Defines a 'To' field in the outgoing message. Multiple instances are allowed.
<sendmail:cc
>
Defines a 'Cc' field in the outgoing message. Multiple instances are allowed.
<sendmail:bcc
>
Defines a 'Bcc' field in the outgoing message. Multiple instances are allowed.
<sendmail:body
>
Defines the body of the outgoing message.
EXAMPLE
my $mail_message = 'I'm a victim of circumstance!';
<sendmail:send-mail>
<sendmail:from>curly@localhost</sendmail:from>
<sendmail:to>moe@spreadout.org</sendmail:to>
<sendmail:cc>larry@porcupine.com</sendmail:cc>
<sendmail:bcc>shemp@alsoran.net</sendmail:cc>
<sendmail:body><xsp:expr>$mail_message</xsp:expr></sendmail:body>
</sendmail:send-mail>
ERRORS
When sending email fails, or an address is invalid, this taglib will throw an exception, which you can catch with the AxKit exceptions taglib.
AUTHOR
Kip Hampton, khampton@totalcinema.com
COPYRIGHT
Copyright (c) 2001 Kip Hampton. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
AxKit, Mail::Sendmail, Email::Valid