sendemail script
{Plugins}{SendEmailPlugin}{Permissions}{Allow}{MailTo} in configure
<form enctype="application/x-www-form-urlencoded" name="mailform" action="%SCRIPTURL{sendemail}%/%WEB%/%TOPIC%" method="POST">
<input type="hidden" name="subject" value="hello!" />
<input type="hidden" name="body" value="howdy!" />
<input type="text" class="twikiInputField" name="to" size="30" />
<input type="submit" class="twikiSubmit" value="Send" />
</form>
%STARTFORM{
name="mailForm"
action="%SCRIPTURL{sendemail}%/%WEB%/%TOPIC%"
method="POST"
onSubmit="return checkPasswords(this)"
}%
<fieldset style="border:1px solid #ddd; padding:1em">
<legend><b>Send Email</b></legend>
%RED%*%ENDCOLOR% All fields are required.
%FORMELEMENT{
name="To"
type="hidden"
title="To:"
default="me@myurl.com"
}%
%FORMELEMENT{
name="Subject"
type="hidden"
default="Account Request"
}%
%FORMELEMENT{
name="Name"
type="text"
mandatory="on"
title="Name (First and Last):"
}%
%FORMELEMENT{
name="Email"
type="text"
mandatory="on"
validate="email"
title="E-mail Address:"
}%
%FORMELEMENT{
name="Password"
type="password"
mandatory="on"
title="Password (caps sensitive):"
}%
%FORMELEMENT{
name="Confirm"
type="password"
mandatory="on"
title="Confirm your password:"
}%
%FORMELEMENT{
name="body"
type="textarea"
rows="10"
cols="80"
cssclass="twikiHidden"
default="$Name
$Email
$Company
$Password
$Confirm"
}%
%FORMELEMENT{
type="submit"
buttonlabel="Send"
}%
</fieldset>
%ENDFORM%
%SENDEMAIL{feedbackSuccess="Request sent, we'll contact you shortly." feedbackError="Could not send your message, please contact us." }%
<script type="text/javascript">
//<![CDATA[
function checkPasswords(inForm) {
if(inForm.Password.value != inForm.Confirm.value) {
alert('Your passwords do not match. Please try again.');
return false;
}
return true;
}
//]]>
</script>
Title and Summary and want to post the values of these fields in the body of the e-mail, eiter:
<input type="hidden" name="body" value="Title: %FORMFIELD{"Title"}%, Summary: %FORMFIELD{"Summary"}%" />
<textarea name="body" class="twikiHidden" cols="80" rows="6">
Title: %FORMFIELD{"Title"}%
Summary: %FORMFIELD{"Summary"}%
</textarea>
| Class name | Note |
|---|---|
sendEmailPluginNotification |
Used for feedback after sending a mail |
sendEmailPluginError |
Styles sendEmailPluginNotification in case of an error |
SendEmailPlugin.zip in your twiki installation directory.
| Plugin Author: | TWiki:Main.ArthurClemens |
| Copyright: | © 2007-2010 Arthur Clemens; 2008 Michael Daum © 2007-2013 TWiki:TWiki.TWikiContributor |
| License: | GPL (GNU General Public License |
| Plugin Version: | 2013-05-28 |
| Change History: | |
| 2013-05-28: | Twikubg:Item7268: HTML email support |
| 2013-04-24: | TWikibug:Item7239 |
| 2013-04-23: | TWikibug:Item7237 |
| 2013-01-24: | TWikibug:Item7129 |
| 2013-01-24: | TWikibug:Item7045 |
| 2012-11-21: | TWikibug:Item7048 |
| 2012-11-21: | TWikibug:Item7047 |
| 2012-11-21: | TWikibug:Item7046 |
| 2011-04-02: | TWikibug:Item6676 |
| 28 Feb 2010 | 1.5.1 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.4.2 Arthur Clemens: Added configure settings to download. |
| 29 Mar 2009 | 1.4.1 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. |
| 06 Nov 2008 | 1.2.3 Michael Daum: Fixed CC emails; fixed css in docu |
| 17 Oct 2008 | 1.2.1 Michael Daum: Added support for TWiki-5; fixed sending emails to login names |
| 26 Jun 2008 | 1.2.0 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.1.3 Arthur Clemens: Fixed bug in bin script that caused form query data to get emptied. |
| 15 may 2007 | 1.1.2 Arthur Clemens: Improved error notifications. |
| 13 May 2007 | 1.1.1 Arthur Clemens: Changed sendmail script invocation to be called through bin script sendemail; added CSS styles for feedback notification; fixed typo 'feedbackSucces'. |
| 05 May 2007 | 1.0 First release. |
| TWiki Dependency: | 4.2 or later |
| CPAN Dependencies: | none |
| Other Dependencies: | none |
| Perl Version: | 5.005 |
| Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/SendEmailPlugin |
| Feedback: | http://TWiki.org/cgi-bin/view/Plugins/SendEmailPluginDev |
| Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/SendEmailPluginAppraisal |