Scroll to navigation

Mail(3pm) User Contributed Perl Documentation Mail(3pm)

NAME

Embperl::Mail - Sends results from Embperl via E-Mail

SYNOPSIS

 use Embperl::Mail ;
    
 Embperl::Mail::Execute ({inputfile => 'template.epl',
                                subject   => 'Test Embperl::Mail::Execute',
                                to        => 'email@foo.org'}) ;

DESCRIPTION

Embperl::Mail uses Embperl to process a page template and send the result out via EMail. Currently only plain text mails are supported. A later version may add support for HTML mails. Because of that fact, normal Embperl HTML processing is disabled per Default (see options below).

Execute

The "Execute" function can handle all the parameter that "Embperl::Execute" does. Addtionaly the following parameters are recognized:

gives the sender e-mail address
gives the recipient address(es). Multiply addresses can either be separated by semikolon or given as an array ref.
gives the recipient address(es) which should receive a carbon copy. Multiply addresses can either be separated by semikolon or given as an array ref.
gives the recipient address(es) which should receive a blind carbon copy. Multiply addresses can either be separated by semikolon or given as an array ref.
gives the subject line
the given address is insert as reply address
Array ref of additional mail headers
Tells Embperl::Mail which charset definition to include in any header that contains character code 128-255 and therefore needs encoding. Defaults to iso-8859-1. Pass empty string to turn encoding of header fields of.
Specifies which host to use as SMTP server. Default is localhost.
Specifies which host/domain to use in the HELO/EHLO command. A reasonable default is normally chosen by Net::SMTP, but depending on your installation it may necessary to set it manualy.
Set to 1 to enable debugging of mail transfer.
If no "options" are given the following are used per default: optDisableHtmlScan, optRawInput, optKeepSpaces, optReturnError
In contrast to normal Embperl escmode defaults to zero (no escape)
As in "Embperl::Execute" you can specify an array ref, which returns all the error messages from template processing. If you don't specify this parameter "Execute" will die when an error occurs.

Configuration

Some default values could be setup via environment variables.

IMPORTANT: For now Embperl::Mail does not honour the Embperl configuration directives in your httpd.conf. Only values set via the environment are accepted (e.g. via SetEnv or PerlSetEnv).

EMBPERL_MAILHOST

Specifies which host to use as SMTP server. Default is localhost.

EMBPERL_MAILHELO

Specifies which host/domain to use in the HELO/EHLO command. A reasonable default is normally chosen by Net::SMTP, but depending on your installation it may necessary to set it manualy.

EMBPERL_MAILFROM

Specifies which the email address that is used as sender. Default is www-server@server_name.

EMBPERL_MAILDEBUG

Debug setting for Net::SMTP. Default is 0.

Author

G. Richter (richter at embperl dot org)

See Also

perl(1), Embperl, Net::SMTP

2022-02-06 perl v5.34.0