|
|
||||
Installing Mail2friend
Mail2friend is installed from the Package Installer section of your netConsole. Select "mail2friend" from the drop-down menu and click the install button.Setting Up Mail2friend
The default form page lacks any real formatting and can be edited to match the look of your site. We recommend you employ a simple ASCII editor such as Notepad (WinOS), SimpleText (MacOS) or Vi/VIM (Unix). The reason for this is many WYSIWYG (What You See Is What You Get) editors (e.g. Adobe GoLive, Macromedia Dreamweaver, Microsoft FrontPage, etc.) will alter the code that the script requires to function.
<a href="page-to-be-mailed.html$MAILPAGE$">Email This Page to a Friend</a>
By using Apache's rewrite engine, any requests for pages with the $MAILPAGE$ text on the end will be seamlessly redirected to the mail2friend form. There are two configuration options for the mail2friend script.The first option allows you to change the name of the form visitors are directed to. By default, the form is called mail2friend.shtml. To change the name of the form, go to the package's configuration page by clicking on the "mail2friend" link on the main Packages page of your netConsole. On the configuration page that follows you may change the name of the form as shown below:
Note: If you specify another form page, please either rename the default form page or use it as a template to build a new one. The reason behind this is the form tag:
<form method="POST" action="/cgi-bin/mail2friend">
the SSI tag executing mail2friend.pl:<!--#exec cgi="/cgi-bin/mail2friend" -->
and the names of the form elements:
<input type="text" name="recip_name">
<input type="text" name="recip_email">
<input type="text" name="sender_name">
<input type="text" name="sender_email">
The other configurable element of the mail2friend script is what page your visitors are redirected to when they complete the form:
<input type="hidden" name="redirect" value="<!--#echo var="PATH_INFO" -->">
With an unmodified script, there's really no need to alter the redirect page. Your visitor will click on the link, fill out the form, submit, and return to the page.However, if you do modify the behavior of the script, i.e. cause the form to be opened in a new window, you will most likely want to redirect your visitors to some other page.
Please note that the value of the hidden redirect form field must be relative to your base URL. For example, if the redirect is to be at http://your-domain-name.com/path/to/redirect.html the form field would look like this:<input type="hidden" name="redirect" value="/path/to/redirect.html">
These will not work:<input type="hidden" name="redirect" value="path/to/redirect.html">
<input type="hidden" name="redirect" value="http://your-domain-name.com/path/to/redirect.html">
Tweaking Mail2friend
There are a number of ways to change the way mail2friend works:
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
################################################################### ## Instructions for editing the subject and body of the message. ## ## There are a few variables you can use in your subject and body: ## $sender_name, $sender_email, recip_name, recip_email, $domain, ## and $url. ## ## Edit the subject of the form-generated message here: ## |
By using some JavaScript, you can take your URL-sharing visitors to the mail2friend form in a new size-specific browser window, instead of launching the form in the same window.
If you do this, you will probably want to specify the URL to the page you want the visitor to be redirected to after submitting the form. See the Redirect Page section of Configuration Options for more information on this.
<a href="<!--#echo var="DOCUMENT_URI" -->$MAILPAGE$">Email this page to a friend</a>
Related Items