Note, that the from, to and cc parameters can be either an email address or a wiki user name, in which case the email address of that wiki user is used instead.
To prevent this plugin to be used as open email relay, by default sending emails is prohibited. To send out mails, first set the mail addresses you want to allow to send to in configure. Each can be a list of comma separated regular expressions that emails are checked against before allowing the mail to be sent.
{Plugins}{SendEmailPlugin}{Permissions}{Allow}{MailTo} - enter .* to allow to send to anyone
%SENDEMAIL{
feedbackSuccess="Request sent, we'll contact you shortly."
feedbackError="Could not send your message, please contact us."
format="<div class=\"foswikiNotification\">$message</div>"
}%
Email template
To customize the email, including its header, create a new template topic and pass the topic name in a mailtemplate form field. The default template is SendEmailPluginTemplate:
The tags %FROM%, %TO%, %CC%, %SUBJECT% and %BODY% are replaced with the respective form values when the email is created.
For a template topic named MailTemplate you can either pass the name Mail or MailTemplate.
The search path for templates always starts in the current web.
Plugin settings are set in configure.
Note: by default any emailing is prohibited. Change the settings in configure to set to which addresses you allow mails to be sent from and to.
CSS classes
HTML elements with these style names are written to the default feedback.
Styles sendEmailPluginNotification in case of an error
Installation Instructions
You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.
Open configure, and open the "Extensions" section. "Extensions Operation and Maintenance" Tab → "Install, Update or Remove extensions" Tab. Click the "Search for Extensions" button.
Enter part of the extension name or description and press search. Select the desired extension(s) and click install. If an extension is already installed, it will not show up in the
search results.
You can also install from the shell by running the extension installer as the web server user: (Be sure to run as the webserver user, not as root!)
cd /path/to/foswiki
perl tools/extension_installer <NameOfExtension> install
2.00 Michael Daum: remove dependency on CGI for rendering html; use utf8 encoding when sending emails; support ajax-sending mail forms
09 Sep 2017
1.55 fix switchboard configuration
15 Mar 2013
1.54 Michael Daum: don't send an empty CC; fix adding css to the header
25 Aug 2011
1.53 Fixes a bug in the example form.
13 Mar 2010
1.52 Improved error feedback and documentation.
28 Feb 2010
1.51 Added forgotten Config.spec file.
08 Jan 2010
1.5 Arthur Clemens: Improved error feedback; added format parameter; moved the mail template to a topic; changed param template to mailtemplate.
03 Jan 2010
1.42 Arthur Clemens: Added configure settings to download.
29 Mar 2009
1.41 Arthur Clemens: Removed default restrictions in Deny settings so that only the Allow setting needs to be set to send emails.
21 Mar 2009
1.4 Arthur Clemens: Moved topic and hardcoded settings to configure.
12 Mar 2009
1.3 Foswiki version.
06 Nov 2008
1.23 Michael Daum: Fixed CC emails; fixed css in docu
17 Oct 2008
1.21 Michael Daum: Added support for TWiki-5; fixed sending emails to login names
26 Jun 2008
1.20 Michael Daum: Added ALLOW/DENY preference settings to prevent this plugin from being used as an open spam relay; added template option allowing more control over email header etc; fixed mod_perl/perperl coding errors; sender address is the current user, it will default to the wikimaster's only as a last resort; allow user names in addition to plain email addresses in From, To and Cc; allow multiple users in To and Cc; added a redirectto, successsection and errorsection options to land on a different feedback page; reorganized code for lazy compilation
16 may 2007
1.13 Arthur Clemens: Fixed bug in bin script that caused form query data to get emptied.
15 may 2007
1.12 Arthur Clemens: Improved error notifications.
13 May 2007
1.11 Arthur Clemens: Changed sendmail script invocation to be called through bin script sendemail; added CSS styles for feedback notification; fixed typo 'feedbackSucces'.