Mutualdiscovery
Our goal is to foster mutual discovery among learners at all stages of cognitive and meta-cognitive growth. Project members take on shifting roles as teacher, student, facilitator, coach, peer and colleague.

Guests are welcome to view our materials. To subscribe, edit, view raw markup, etc., you'll need to register for an account. Accounts are free (and will always be free) - your involvement helps us directly and indirectly (by demonstrating that our work matters to our funders...) StartingPoints has more info.
Mutualdiscovery » TWikiUsers » AndrewSutters

Foswiki Contribution Idea

The Idea

I've been looking through the foswiki website and have been somewhat overwhelmed by the vast quantities of information on there.

I'd like to make some kind of contribution but I'm afraid my skills may hinder me making any kind of useful addition.

That being said... here is my idea.

I work part time in a technical support position and they have been thinking of implementing some kind of knowledge base. I of course told them about wiki's smile What I would like to add in to the wiki would be something somewhere on the page that you could either 1) Add an email address to, which would then email the current page to the person's email address you entered or 2) A button that would pop up a box to enter the email address to.

This would allow a tech support rep to search the knowledge base, which could be potentially filled with "HowTo's", and then email the page found to the user. If the wiki was internal this would be the easiest way of giving the information over or if the wiki was externally accessible by "customers" you could forward the url to them using this plugin.

Feedback from HilaryHolz

hmmmm, how interesting. I think I see what you want to do and why (and I think it is a great, great idea, by the way), but I’d like to be sure that we are on the same page, and I want to try to do that without influencing where you are going in your design. So...

Could you sketch out a scenario for each of your two use cases (internal wiki and customer-support wiki)? It's ok to say [...and then magic happens here...] at various points in a scenario as part of the design process.

The Idea Explained (a little more indepth)

Ok so we could potentially have two different scenarios.

Preamble - In a customer service/ tech support environment if a customer phones in with a problem, the agent needs to either try and fix the problem over the phone or create a ticket for a support agent to go and see the person to try and fix their problem.

1) In scenario one, a customer calls asking how they go about setting up a particular program. Now because the wiki is such that it is only available to the tech (the customers have no access to this wiki), the agent can search through the wiki to find the particular install "howto". When the agent has found the relevant page they will want to give it to the customer to follow (somehow), this is done in an effort to get the customer to fix the problem themselves (if it is simple enough) to prevent the need for a tech to go out and do it. To do this they will enter the email address of the customer into a field on the right of the wiki page and below it there will be a "MailIt" button. This button will grab the current page of text that the agent has found and email it to the customer. The customer will receive all of the html generated text in an email detailing how to set up the program. In essence the "MailIt" button will send the "HowTo" page in an email format to the person.

2) In scenario two, the only thing that differs is that the customer does have access to the wiki pages. The wiki is open to the public and is viewable by all customers in the firm/organization. Therefore when they call up looking for information on a certain program install, the agent can, instead of sending them the whole page as an email, send them the url of the page with the "howto" on it. This scenario will also have the same field and "MailIt" button setup but this time only the url will be sent. This will hopefully cut out a couple of steps like opening an email program, copy and pasting the url, etc. Although this seems like a bit of a waste of time, the ease of operation will help the agent in his day to day life, especially if you imagine them taking 50-60 calls in a day.

The standard email would be sent with the email address of either the agent logged in or the "servicedesk" as a return address. It would also be signed by one of the two.

In a slightly more complicated and verbose approach, clicking the "MailIt" button would either popup a box or redirect to a new page, where you could enter more details in the email, such as extra instructions, attachments, return email address, etc.

Hopefully this makes a little more sense that before smile

The Research

Things to look for:

  • How to add a box on the wiki page
    • So it's time to learn to walk before I can run. Some tutorial's on CGI will help out here. This seems like a good place to start.
    • I've just been reading Saltzman's book on Modern Perl Programming and I now have a much better understanding of the operation of CGI scripts and how to go about creating a small html form to pass data between the webpage and the CGI scripts residing on the server. To test this out I will need to create a sample HTML page with a form with a field for entering the email address and a button which will be used to submit the information.
    • When the button is pressed the perl cgi script on the server will be called. It can either take data from GET or POST. I think POST will be of more use in my case as it has no limitations on the size of the data being passed through it. It uses STDIN rather than through the url. The email address itself could be sent with GET if I can get the html data some other way.
    • However I do still need to work out exactly how and where I add this html code to the foswiki page.
  • How to submit a string to the perl module
    • Solved: This is done using an html form which the cgi script can pull the data from when a button is pressed.A good example of this starts on page 245 of Saltzman.
  • How to email a user with the submitted string
    • There are a variety of existing perl modules that have this functionality. What I need to work out is how I can link to other perl modules from my cgi script.
  • How to copy all of the html generated information

  • How to include all of the generated info in the email

  • Ok here we go.. I was searching the internet for "good perl email modules" and I think I have come across something extremely useful here it has examples on how to use email and most importantly it has examples of how to take an html page and email it!. Now on first glance it seems usable, it appears to use mailman to send the emails ( need to work out of this is going to be suitable).

  • Mailman is just a variable used to store the email server. I'll need to see what email server I can use to send email from. The code links from here which appears to have a large array of interesting code which I can possibly use here.

  • Things are looking good, the code and documentation are quite extensive.

  • I've spent the last 3 or so hours trying to work out how to integrate my potential code into the wiki. I've found some interesting information.
    • The default skin that ships with foswiki is called PatternSkin? and lives in /var/www/foswiki/pub/System/PatternSkin
    • I downloaded and installed firebug for firefox which allowed me to look at all of the css and html code generated by a twiki page, but it did not however allow me to see where my code should go.
    • I was under the impression that there must be a file somewhere which contained the relevant data. So I've been browsing through all the files and folders found in the /foswiki dir. Notable folders include the /templates folder which contains all of the default templates which are use to generate the pages. I thought that I may find what I was looking for in here, which is the sidebar that I want to add my little form to. But no luck.
    • Endless google searches and looking through the foswiki System pages brought me across the PatternSkin? page itself. The easiest way to find this is to go to the "Jump" box at the top of the page and type in PatternSkin? . You can also see it here
    • In the PatternSkin? page you can do some configuring of the bars, border and it tells you where to put the preferences.
    • It also highlights that you can edit the sidebars, topbar and bottombar which is what I was looking for! This must have been what I found earlier when I was looking through /var/www/foswiki/data/System. This dir was filled with .txt files which is how I have found foswiki to operate. It uses .txt files to represent pages.
    • Getting closer to the truth Navigating to this webpage I almost found what I was looking for. This is the representation of the .txt files I found earlier. Topic WebLeftBar? defines the content of the left bar. Each web has its own WebLeftBar? . If this topic does not exist the topic WebLeftBarExample? will define the left bar. Foswiki does not ship with WebLeftBar? topics so by creating these topics as copies of WebLeftBarExample? and customizing the copies, you will not later risk that upgrading Foswiki will overwrite your left bars. You can choose to display the WebLeftBar? on the right side of the screen.
    • Finding this led me on to the next idea of, "If there's a Jump and Search box in the topbar surely I can look at that to see how they include html Forms in the wiki page." This thought came after trying to copy some html form code into the html representation of the edit box (which didn't work out too good). I did this by editing the WebLeftBarExample? page, hitting the "Edit HTML Source" button and entering the html form code in there. All that came out was 4 words and that was it, it had chopped off all of the rest. Which I believe had something to do with the WYSIWYG editor.
  • So I had a look at the WebTopBarExample? and low and behold html form code! All be it rather strangely formatted.
<a href="%WEBLOGOURL%">%WEBLOGOALT%</a>    <noautolink>

    * <form name="jumpForm" action="%SCRIPTURLPATH{"view"}%/%BASEWEB%/%BASETOPIC%"><input id="jumpFormField" type="text" class="foswikiInputField" name="topic" value="" size="18" /><noscript> <input type="submit" class="foswikiButton" size="5" name="submit" value="%MAKETEXT{"Jump"}%" /> </noscript> </form>
    * <form name="quickSearchForm" action="%SCRIPTURLPATH{view}%/%BASEWEB%/WebSearch"><input type="text" class="foswikiInputField" id="quickSearchBox" name="search" value="" size="18" /><input type="hidden" name="scope" value="all" /><input type="hidden" name="web" value="%BASEWEB%" /><noscript> <input type="submit" size="5" class="foswikiButton" name="submit" value="%MAKETEXT{"Search"}%" /> </noscript> </form>
    * %INCLUDE{%SYSTEMWEB%.LanguageSelector}%

</noautolink>
  • When I opened this up in the editor it was set up in a table with two boxes, on the left was the WEBLOGURL and on the right the form.
  • Some research was needed to find out exactly what "<..noautolink>" and "<..noscript>" were used for. ( Dots inserted so the page didn't break).
<noscript>...</noscript>
    Replacement content for scripts. Unlike script this can only be used as a block-level element.
    Standardised in HTML 4.0; still current.

Prevent automatic linking of WikiWords and acronyms (if set to on); link WikiWords (if empty); can be overwritten by web preferences:
    * #Set NOAUTOLINK =
    * Note: You can still use the [[...][...]] syntax to link topics if you disabled WikiWord linking. The <noautolink> ... </noautolink> syntax can be used to prevents links within a block of text. 
  • I am going to assume these are used so that the wiki handles the form boxes correctly.

Reflecting on Research

It certainly took a lot of research but I think I am now ready to get underway with the coding and implementation. Before I do so I want to break it down into "todo's" again.

  • Create a form that includes a text field and a button to submit the email address.
  • Insert the form code into the WebLeftBarExample?
  • Look at the code from here and see what needs to be changed in order for me to use this.
  • Find out where my apache server stores its CGI files. This is where the perl file I create will go
    • The cgi files should probably go here /var/www/cgi-bin
  • Begin work on my perl file, piecing together the prior information into a complete module/plugin?
  • Copy the newly created .pl file into the CGI directory on the apache server.
  • Type in an email and press the "MailIt" button and cross my fingers that it works!!

  • I just realised that the perl code I found generates emails from an html file!! But will this work with the wiki?????
  • If this doesn't work with the wiki page I may have to step things back and try and just send the url to the person as in scenario 2 first. Walk before you can run....
  • HowTo use gmail to send email with perl
  • Created a gmail account to use as a tester. webbasedsysemailer@gmailHYRUQAPZ.com
  • Assuming the perl code I found does work, all I will have to do is to pass the URL with the email address to make it work, which is scenario 2, enveloped into scenario 1.
  • I think I should be able to do this using the $ENV{HTTP_REFERER} environmental variable which is the "URL of the document containing the link to this script".

Code Ideas

The Form
<FORM METHOD=GET ACTION="http://localhost/cgi-bin/mailit.pl">.
Email This Page
<INPUT TYPE=text NAME=emailaddress VALUE="my.address@example.com">
<INPUT TYPE=submit VALUE="MailIt">
</FORM>

Which then becomes...

<noautolink>
<FORM METHOD=GET ACTION="http://localhost/cgi-bin/mailit.pl">.
Email This Page
<INPUT TYPE=text NAME=emailaddress VALUE="my.address@example.com">
<noscript><INPUT TYPE=submit VALUE="MailIt"></noscript>
</FORM>
</noautolink>

For some reason it doesn't want to display the form. There must be another setting somewhere........

Found it! All of the form code needs to be made "Protected on save" for it to pop up as the actual form in the wiki.

Update (Mon June 8th 09)

|<sticky> </sticky><sticky><noautolink></sticky><sticky><form method=get action="http://localhost/cgi-bin/mailit.pl"></sticky><sticky><center>Email This Page</center></sticky><sticky><input type=text name=emailaddress value="my.address@example.com" size="18"></sticky><sticky><center><input type=submit value="Mail It"></center></form></sticky><sticky></noautolink></sticky>|

This is the code that lives in the WebLeftBarExample? .txt, located in /var/www/foswiki/data/System. Editing this directly is the same as using the edit button in the wiki. This shows the final and updated code for the mailit button element.

The Next Steps

Now that the input box and button are in place and working it's time to create the perl module. I'm going to through the following stages

  • Create mailit.pl in the /var/www/cgi-bin dir
  • Simple test to see that email is sent
    • Connects to google server and sends (using this webpage)
    • Contains full body with test info
    • Hard coded email address
The sample email page comes with an extra zip file with a whole load of extra stuff. I need to work out where these go. Possibly the /var/www/cgi-bin ?

It would appear that we have a couple of options. Going by the info on this website you can either copy it to one of the perl directories listed in @INC or you can add a small line of code to tell it where to look. This will tell the perl module where to look for the extra perl module when we use the "use" functionality. For example....

use lib qw(/myPerl/myModules/);
use SayHello;

I moved the folder to /usr/lib/perl5 and renamed it to a short name of chilkat. Thus I will include the following in my code.

use lib qw(/usr/lib/perl5/chilkat/);
use chilkat;

I'm not exactly sure this is correct, but it seems so.

I'm having some trouble getting the perl file to execute from within apache. When I click on the mailit button I am getting this..

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@andy-laptop and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

I have tried replacing the mailit.pl file with a simple hello world file and eventually got it to run. It needed to have its permissions changed to 0755, have the #!/usr/bin/perl included and also

print "Content-type: text/html\n\n";
For it to work.

Looking at the apache logs in /etc/httpd/logs i see this...

[Sun Jun 07 11:33:12 2009] [error] [client 127.0.0.1] Can't locate loadable object for module chilkat in @INC (@INC contains: /usr/lib/perl5/chilkat/ /usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi /usr/local/lib/perl5/site_perl/5.10.0 /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.10.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.10.0/i386-linux-thread-multi /usr/lib/perl5/5.10.0 /usr/lib/perl5/site_perl .) at /usr/lib/perl5/chilkat//chilkat.pm line 11, referer: http://andy-laptop/foswiki/System/WebLeftBarExample
[Sun Jun 07 11:33:12 2009] [error] [client 127.0.0.1] Compilation failed in require at /var/www/cgi-bin/mailit.pl line 6., referer: http://andy-laptop/foswiki/System/WebLeftBarExample
[Sun Jun 07 11:33:12 2009] [error] [client 127.0.0.1] BEGIN failed--compilation aborted at /var/www/cgi-bin/mailit.pl line 6., referer: http://andy-laptop/foswiki/System/WebLeftBarExample
[Sun Jun 07 11:33:12 2009] [error] [client 127.0.0.1] Premature end of script headers: mailit.pl, referer: http://andy-laptop/foswiki/System/WebLeftBarExample
Not so pretty...

Hit a rather large brick wall.....

"The Chilkat Perl module is only available for Microsoft Windows computers. A Perl program must load it using this code:"

Back to the drawing board frown Need to find a new email sending perl module.

So a quick search on google turned up a lot of good stuff for "perl email module using gmail". Theres even a module on CPAN which I'm going to try and use first, there were a lot of other options...

Installing this module is appearing harder than I first expected as cpanp doesn't seem to find it and either does yum. It has a lot of dependencies. Had a look at the SEND::EMAIL module and it says its outdated but i've found a lot of examples using it. There's so many email modules its hard to tell which one to use, quite overwhelming..

Well I'm somewhat lost right now, been trying to use this website and install Email::Send::SMTP::TLS. It took quite a lot of dependency installs, important note: helps to have gcc installed!

So I think I have all of the dependencies installed and I tried to run this script:

#!/usr/bin/perl

    use Email::Send;
    
    my $mailer = Email::Send->new( {
        mailer => 'SMTP::TLS',
        mailer_args => [
            Host => 'smtp.gmail.com',
            Port => 587,
            User => 'webbasedsysemailer',
            Password => 'xxxxxx',
            Hello => 'test.org',
        ]
    } );
    
    use Email::Simple::Creator; # or other Email::
    my $email = Email::Simple->create(
        header => [
            From    => 'webbasedsysemailer@gmail.com',
            To      => 'asutters@horizon.csueastbay.edu',
            Subject => 'Test email',
        ],
        body => 'This is a test email',
    );
    
    eval { $mailer->send($email) };
    die "Error sending email: $@" if $@;

But when I run the file, no emails get sent. My idea was to use gmail to send the emails and so now I'm looking at the Email::Send::Gmail module. One of these things has to work!!

Update: well I spent the best part of 5 hours trying to get something to work. I tried sendmail which had problems with permissions, then I tried to install Email::Send::Gmail. However the dependencies would not install with cpanp or by manually downloading them and trying to install them. For some reason I had forgotten about yum. After stumbling across this webpage I noticed the author had mentioned installing the dependencies from a repository!! The lightbulb turns on So low and behold, I searched for and installed:

  • Net_SSLeay.pm (Open SSL)
  • IO-Socket-SSL
  • Authen-SASL
  • Net-SMTP-SSL

This then allowed me to go into cpanp, type in

i Email::Send::Gmail

And it worked. Note that you need to have Email::Send and Email::Simple::Creator installed first. These were easily enough installed with cpanp. Then looking at cpan for some example code I edited a new file chmod +x it and ran it. Some email finally turned up in my inbox!!

#!/usr/bin/perl
  use strict;
  use warnings;
  use Email::Send;
  use Email::Send::Gmail;
  use Email::Simple::Creator;

  my $email = Email::Simple->create(
      header => [
          From    => 'magic_monitoring@gmail.com',
          To      => 'acme@astray.com',
          Subject => 'Server down',
      ],
      body => 'The server is down. Start panicing.',
  );

  my $sender = Email::Send->new(
      {   mailer      => 'Gmail',
          mailer_args => [
              username => 'magic_monitoring@gmail.com',
              password => 'XXX',
          ]
      }
  );
  eval { $sender->send($email) };
  die "Error sending email: $@" if $@;

I can now finally get on with trying to integrate this into the wiki.

Email Finally Working - Moving On

  • Take the email from the input box and use that to send the email
  • Take the URL from the page and input that into the body of the email

Ok so.... I guess I skipped a little bit of the documentation steps here as I had my head in the code trying to get things to work. Here is how the code looks now..

#!/usr/bin/perl
#use strict;
use warnings; 
use Email::Send;
use Email::Send::Gmail;
use Email::Simple::Creator;
use CGI;
CGI::ReadParse();

my $emailAdd = $in{emailaddress};

my $email = Email::Simple->create(
    header => [
        From    => 'webbasedsysemailer@gmail.com',
        To      => $emailAdd,
        Subject => 'Your Help Request',
    ],
    body => "Please see this url for further information: $ENV{HTTP_REFERER}",
);

my $sender = Email::Send->new(
    {   mailer      => 'Gmail',
        mailer_args => [
            username => 'webbasedsysemailer@gmail.com',
            password => 'xxxxx',
        ]
    }
);
eval { $sender->send($email) };
print "content-type: text/html\n\n";
print <<EOF;
<HTML>
<HEAD><TITLE>Success</TITLE>
<HEAD>
<BODY>
<H3><CENTER>You have sent an email to $emailAdd</H3></CENTER>
<H3><CENTER>It contained the url: $ENV{HTTP_REFERER}</H3></CENTER>
<H3><CENTER> Return link: <a href="$ENV{HTTP_REFERER}">Take Me Back</a></H3></CENTER>
</BODY>
</HTML>
EOF
die "Error sending email: $@" if $@;

It does the following:

  • The form takes in an email address from the user and passes it to the mailit.pl script.
  • The script uses gmail to send an email to the address defined by the user.
  • In the email body a url is appended. This is the url of the page that invoked the form. Which is the url of the page that we will want to send to customers!! This is done using
    $ENV{HTTP_REFERER}
    
  • The script will then return a page to the user showing them that their emailing has been successful and will provide them a link to where they once came from.
  • Now you will notice that use strict is commented out at the top. This was causing my script to crash out when run by apache. It was giving the following error messages.
[Mon Jun 08 13:37:31 2009] [error] [client 127.0.0.1] Global symbol "%in" requires explicit package name at /var/www/cgi-bin/mailit.pl line 10., referer: http://andy-laptop/foswiki/System/WebLeftBarExample
[Mon Jun 08 13:37:31 2009] [error] [client 127.0.0.1] Execution of /var/www/cgi-bin/mailit.pl aborted due to compilation errors., referer: http://andy-laptop/foswiki/System/WebLeftBarExample
[Mon Jun 08 13:37:31 2009] [error] [client 127.0.0.1] Premature end of script headers: mailit.pl, referer: http://andy-laptop/foswiki/System/WebLeftBarExample
  • I still haven't worked out the error.

However the functionality now in place satisfies the requirements for scenario 2

What About Scenario 1??

When I originally started out with this project, my intentions were to implement scenario 1. Scenario 2 was just supposed to be a stepping stone to the final goal of sending the whole html page as an email. But with the discovery that my intended set of modules were for windows only?!?! this kind of sunk the ship as it were, primarily due to the lack of time to try and implement the thing on my own, which I don't think I have the perl knowledge yet to do anyways... Also, the implementation of scenario 2 was far harder than I had originally anticipated... So that being said, I'd like to quickly go over the Scenario 1 example and plan out how I or somebody else could go about implementing it, based on the idea I had. Also I may throw some extra ideas about.

  • With scenario2 pretty much implemented and the code available I now turn to scenario 1, which essentially will take the page your looking at and email it to a user.
  • The functionality is in place to send email to the user, including a link to the page you are currently looking at, the emailer is using SMTP, which should allow us to send email with HTML embedded in it. I also found another nice module called MIME::LITE, which allows for HTML embedding and handles things like pictures etc, which could prove very useful when representing a full webpage in the email.
  • Now, I'm not 100% sure how one would go about taking the html page and putting it into an email. But I can imagine two ways, 1. Copying all of the html and elements of the webpage, pictures, etc and then putting them into the email format and sending them. This is like copying everything to the local hard drive and sending them. 2. Copying all of the html and associated picture links(urls), then putting this into the email. This would then link to the pictures etc and display them on the email client. This would only work with a relatively sophisticated email client however.
  • So, when you click on the MailIt? button, an email would be sent to the user with the entire webpage included, allowing them to follow the steps and "hopefully" fix their problem.
  • You could also have something appended to the bottom to allow them to seek extra assistance or to alert you to the fact that they had managed to fix their problem. This could be an automatic email response or something to that effect.

I'm sure there must be a module out there that does something similar to this, and if not then it should definitely get made sometime soon. I think this would prove very useful to those who use wiki in a customer service environment.

Other Ideas suggested by Professor Holz and then worked out by myself

To use the email idea to provide a way of sending the contents of a wiki page to someone to allow them to "catch up" on what you had been working on and to potentially seek assistance on the problem you are working on. This would be useful if the wiki was internal and you couldn't give the outside person access to it, but you were still looking for help on resolving a problem.

To use the MailIt? button as a way of seeking assistance. If the wiki was used throughout a whole organization and everyone had access to it, including normal workers and tech support people, then a normal user could document their workings etc. And if they come across a problem the "HelpMe" button could then be used to automatically email tech support, with either the text/pictures from the page they are working on, or a link to the wiki page. This would then provide the tech support people with all the necessary information, allowing them to help the person out in a far easier fashion because they have the wealth of information which normally tech support people don't tend to have when presented with problems.

Summary and Final Code

Well my time is up, I have to get started studying for my Finals and so this is the end of the project. I hope that what I have done will be of use to somebody and that I explained it in a thorough enough manner that it could be taken further. The final code for the MailIt? form and the perl email script can be found below.

#!/usr/bin/perl
#use strict;
use warnings; 
use Email::Send;
use Email::Send::Gmail;
use Email::Simple::Creator;
use CGI;
CGI::ReadParse();

my $emailAdd = $in{emailaddress};

my $email = Email::Simple->create(
    header => [
        From    => 'webbasedsysemailer@gmail.com',
        To      => $emailAdd,
        Subject => 'Your Help Request',
    ],
    body => "Please see this url for further information: $ENV{HTTP_REFERER}",
);

my $sender = Email::Send->new(
    {   mailer      => 'Gmail',
        mailer_args => [
            username => 'webbasedsysemailer@gmail.com',
            password => 'xxxxx',
        ]
    }
);
eval { $sender->send($email) };
print "content-type: text/html\n\n";
print <<EOF;
<HTML>
<HEAD><TITLE>Success</TITLE>
<HEAD>
<BODY>
<H3><CENTER>You have sent an email to $emailAdd</H3></CENTER>
<H3><CENTER>It contained the url: $ENV{HTTP_REFERER}</H3></CENTER>
<H3><CENTER> Return link: <a href="$ENV{HTTP_REFERER}">Take Me Back</a></H3></CENTER>
</BODY>
</HTML>
EOF
die "Error sending email: $@" if $@;

This may look ugly, but is actual foswiki wiki code for the button and form.

|<sticky> </sticky><sticky><noautolink></sticky><sticky><form method=get action="http://localhost/cgi-bin/mailit.pl"></sticky><sticky><center>Email This Page</center></sticky><sticky><input type=text name=emailaddress value="my.address@example.com" size="18"></sticky><sticky><center><input type=submit value="Mail It"></center></form></sticky><sticky></noautolink></sticky>|

In it's regular form it looks like this

<FORM METHOD=GET ACTION="http://localhost/cgi-bin/mailit.pl">.
Email This Page
<INPUT TYPE=text NAME=emailaddress VALUE="my.address@example.com">
<INPUT TYPE=submit VALUE="MailIt">
</FORM>

-- AndrewSutters - 21 May 2009

r13 - 13 Jun 2009 - 15:50:23 - HilaryHolz
Guests are welcome to view our materials. To subscribe, edit, view raw markup, etc., you'll need to register for an account. Accounts are free (and will always be free) - your involvement helps us directly and indirectly (by demonstrating that our work matters to our funders...) StartingPoints has more info.
This site is powered by the TWiki collaboration platformCopyright 1999-2009 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Ahatwiki? Send feedback Syndicate this site RSSATOM