Kjetil Kjernsmo > AxKit-XSP-Sendmail-1.5 > AxKit::XSP::Sendmail

Download:
AxKit-XSP-Sendmail-1.5.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 1.5   Source  

NAME ^

AxKit::XSP::Sendmail - Simple SMTP mailer tag library for AxKit eXtensible 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 omitted, the default set in Mail::Sendmail's %mailcfg hash will be used instead.

<sendmail:from>

Defines the 'From' field in the outgoing message. If omitted, 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. By default this taglib will remove leading and trailing spaces from the value <sendmail:to> contains. If you need to turn this off, simply set the trim attribute to 'no'. The same can be done for all header fields.

<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:subject>

Defines the subject of the message.

<sendmail:content-type>

Defines the content-type of the body of the message (default: text/plain).

<sendmail:content-transfer-encoding>

Defines the content-transfer-encoding of the body of the message. The default depends on whether you have MIME::QuotedPrint available or not. If you do, it defaults to 'quoted-printable', and if you don't to '8bit';

<sendmail:charset>

Defines the charset of the body of the message (default: utf-8). Your system's iconv implementation needs to support converting from utf-8 to that character set otherwise sending email will fail.

<sendmail:header>

Allows you to add headers to the outgoing mail with the name specified in the name attribute.

<sendmail:body>

Defines the body of the outgoing message.

<sendmail:message>

This tag is interchangable with <sendmail:body>.

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

Kjetil Kjernsmo, kjetilk@cpan.org has taken over maintainership of this module as of 1.41.

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

syntax highlighting: