Peasy Mail

Web Server

Sartronics.com Peasy Mail server comes with an in built light web server. It is used to display a basic web site. Peasy Web Server supports a set of special instruction to support shopping carts, statistics and allow common HTML sections to use single files.

To set it up all that is required is to specify a folder where the web site's HTML files are kept it along with the home page and to enable the IP port on which to listen.

The web server options are available from the menu Server > Web server options.

.

 

Web wizard

To get started quick with a brand new website just use the web wizard from the menu Server > Web wizard. It will quick generate a simple demonstration web site. This can then be used as starting point for a working web site. Using the web editor the

 

 

Web Editor

To easily edit the web site pages use the web editor from the menu Server > Web editor.

 

 

Special instructions

The special instructions are inserted into HTML files. They all have the following format.

        <?Peasy ... />

This ables the code to be used in HTML files without any confict. The <? and /> follow the rules for HTML tag. The <?Peasy make it a special tag that is only understood by the Sartronics Peasy Web Server. Other Web servers will just ignore this and send it on as part of the HTML file. Note that these special instuctions can not be embedded into other HTML tags, that would break the rules for HTML format.

 

The Peasy Web Server will remove these instructions and replace it with the intended HTML data if any.

 

The following list the supported special instructions. Note that they can be easily set and adjusted with the Web Editor.

 

Instruction

Description

include

Includes a file.

<?Peasy include(file="title.html") />

products.create

Creates a new product. If the product code is the same it will update the product.

<?Peasy products.create(code="MYCODE123",price="US$100.00") />

products.text

Displays the text for a products attribute.

<?Peasy products.text(code=MyStockCode01,attrib=price)/>

products.thumbnail

Displays the products thumbnail picture. <?Peasy products.thumbnail(code=MyStockCode01,width=200,height=100)/>

products.image

Displays the products image. There can be several picture with an index number. <?Peasy products.image(code=MyStockCode01,index=2,width=200,height=100)/>

customer.cart

Genates a customer cart table.

<?Peasy customer.cart(nextpage=checkout.html,button="Proceed",updatebutton="Update"col(name="Product",width=150,attrib=name)/>

customer.details

Generates a page to allow a customer to enter there details.

 

<?Peasy customer.details(nextpage=thankyou.html,button="Purchase",field(label="Your first name",attrib=name,required=yes)/>

customer.save

Logs the customer details and their purchase to a file.

<?Peasy customer.save(file="\Data\orders.txt")/>

customer.email

Creates and send an email of the customer details and their purchase to a mail receipient.

<?Peasy customer.email(to=sales@mysite.com)/>

customer.ref

This displays the purchase reference number.

<?Peasy customer.ref/>

stats.pages

Creates a table of daily hit counts for every HTML page. This does not include web bots or local connection.

<?Peasy stats.pages(col(name="Page Name",width=600,attrib=name),col(name="Hit Count",width=200,attrib=hitcnt,days=14),page(name="thankyou.html"))/>

stats.pagecnt

This gives a count of pages with regards to options supplied. <?Peasy stats.pagecnt(htmlonly,nojpg,nopng,nogif,notxt,nozip)/>

stats.visitors

Creates a table of visitors with a count of the number of times they visited.

<?Peasy stats.visitors(col(name="Address",width=400,attrib=ip),col(name="Name",width=600,attrib=name),col(name="Visits",width=200,attrib=visits)) />

stats.visitorcnt

This gives a count of visitors with regards to options supplied. <?Peasy stats.visitorcnt(norobots,nolocals,browseronly)/>

stats.visits

This gives a count of the total number of unique visits of various types. This has to be one of the items in the "Statistics Visits type parameter". Refer below. Note this number can be bigger than the table of visits, as the table data expiry and can be over written if too much data is collected.

<?Peasy stats.visits(type=browsers)/>

stats.since

This prints the date time since the statistic began. This reflects the last time that the web statistics were reset.

<?Peasy stats.since/>

graph.pages

Creates a bar chart of the daily hit counts (not including web bots or local connection), with days on the x axis and the hit count on the y axis.

<?Peasy graph.pages(page="index.html",width=800,height=600,x(name="Days from today"),y(name="Hit Count"))/>

Action.email

This sends an email when the page is viewed.

<?Peasy action.email(to="sales@sartronics.com")/>

uptime

This displays the date time when the server last restarted.

<?Peasy uptime/>

 

 

Product Create parameter types

Parameter types

Description

code

Product code. Note this is used as a reference to this product. This field is required the other field

price

Sale price of the product.

name

Name of the product.

model

Product model.

version

Product's version.

revision

Products revision.

description

Description of the product

summary

Brief description of the product.

thumbnail

Small image of the product.

image

Images of the product.

quantity

Quantity of stock or quantity to purchase.

weight

Weigh of product.

 

 

Customer Cart parameters

Parameter

Description

nextpage

Next HTML page to proceed to.

button

Button label to proceed to next page to purchase goods.

updatebutton

Update button label to update the price based upon new quantity entered.

width

Percentage width of the table to the page.

col

Attributes of cart column. Refer below.

 

 

Customer Cart Col (column) parameters

Parameter

Description

name

Name of the column. It is shown at the top of the column.

width

Width of the column.

attribute

Attribute of the product to display in the column.

 

 

Customer Details parameters

Parameter

Description

nextpage

Next HTML page to proceed to.

button

Button label to proceed to next page to purchase goods.

width

Percentage width of the table to the page.

field

Customer attributes to show in the field

 

 

Customer Details field parameters

Parameter

Description

label

Label for the field

attribute

Attribute of the customer to display in the field. This has to be one of the items in the "Customer Details field parameter type". Refer below.

required

This field must be entered in order to continue. This parameter can be set to "yes" for true or "no" for false, if not set to either it will be set to true. If not specifed at all then is is not set and the parameter will be false.

sameline

This means that this field will continue on the same line. This parameter can be set to "yes" for true or "no" for false, if not set to either it will be set to true. If not specifed at all then is is not set and the parameter will be false.

multiline

This is a multiline field. The number of columns and rows can also be specified.This parameter can be set to "yes" for true or "no" for false, if not set to either it will be set to true. If not specifed at all then is is not set and the parameter will be false.

cols

Number of characters across a multiline field.

rows

Number of rows down a multiline field.

 

 

Customer Details field Attrib (Attribute) type

Attribute type

Description

name

Customer's name

surname

Customer's surname

company

Company

address

Customer's address

country

Customer's country

postcode

Customer's post code

email

Customer's email

hometel

Customer's home telephone number

mobiletel

Customer's mobile telephone number

cctype

Credit card type

ccnumber

Credit card number

ccmonth

Credit card expiry month

ccyear

Credit card expiry year

ccname

Name on credit card

ccvalid

Credit card validity code

notes

Purchase notes

cctype.visa

Visa credit card type

cctype.master

Mastercard credit card type

cctype.amex

American Express credit card type

 

 

HREF to add a product to a customers cart

To add a product to a customers cart use the following at the end of the href file path.

    <a href="../cart.html?for=cart&add=MyCode1">

This will open up the page ../cart.html and place the product with code MyCode1 onto the customers list.

 

 

Stats (Statistics) Pages parameters

Parameter

Description

col

Attributes of a tables column. Refer below.

nohtml

Exclude html pages

nojpg

Exclude jpeg pages from the list.

nopng

Exclude png pages from the list.

nogif

Exclude giff pages from the list.

notxt

Exclude text pages from the list.

nozip

Exclude zip pages from the list.

nocss

Exclude css files from the list.

only

Only is used to restrict the pages to one type. Such as only=html This can be set to one of the following

html

jpeg

png

giff

text

zip

css

 

 

Stats (Statistics) Pages Col (column) parameters

Parameter

Description

name

Name of the column. It is shown at the top of the column.

width

Width of the column.

attrib

Attribute of the page statistic to display in the column.

This can be one of the following.

name

hitcnt

hitcntav

days

This is only used if the column attribute is set to hitcnt. This allows the hit count to be shown for a number of days with a separate column for each day. If the name parameter is not specified then the date will be used for the column heading.

 

 

Stats (Statistics) Pages Page parameters

Parameter

Description

name

Name of the web page to include in the table.

Note that without this parameter then all pages will included, with the exception of any that do not meet the page type exclusion settings

 

 

Stats (Statistics) Visitors parameters

Parameter

Description

col

Attributes of a tables column. Refer below.

norobots

Exclude web robot seach engine visitors files from the list.

nolocals

Exclude local visitors from the list. This are visitors with an IP address of 127.0.0.1, 198.168.*.* or 10.*.*.*.

nobrowsers

Exclude visits from a browser. These are visitors that request favicon.ico file.

only

Only is used to restrict the visitor to one type. Such as only=browers This can be set to one of the following

robots

locals

browsers

 

 

Stats (Statistics) Visitors Col (column) parameters

Parameter

Description

name

Name of the column. It is shown at the top of the column.

width

Width of the column.

attrib

Attribute of the page statistic to display in the column.

This can be one of the following

address

name

visits

since

robots

local

browser

 

 

Stats (Statistics) Visitors Col (column) Attrib (Attributes)

Parameter

Description

address

Visitors WWW address.

name

The hostname of the visitors IP address.

visits

Number of visits.

since

This shows the data time since last visit.

robot

This column shows "yes" if the visitor is a web robot search engine.

local

This column shows "yes" if the visitor is local.

browser

This column shows "yes" if the visitor is a browser.

 

 

Stats (Statistics) Visits Types

Types

Description

all

This gives a count of the total number of unique visits not including web robots or local connection. Note this number can be bigger than the table of visits, as the table data expiry and can be over written if too much data is collected.

<?Peasy stats.visits(type=all) />

browsers

This gives a count of the total number of unique visits.  Note this number can be bigger than the table of browser visits, as the table data expiry and can be over written if too much data is collected.

<?Peasy stats.visits(type=browser)/>

robot

This gives a count of the total number of unique robot visits. Note this number can be bigger than the table of robot visits, as the table data expiry and can be over written if too much data is collected.

<?Peasy stats.visits(type=robot)/>

local

This gives a count of the total number of unique visits.  Note this number can be bigger than the table of local visits, as the table data expiry and can be over written if too much data is collected.

<?Peasy stats.visits(type=local)/>

day

This is the average unique visits per day. This does not include web bots or local connection.

<?Peasy stats.visits(type=day)/>

 

 

Graph Pages parameters

Parameter

Description

page

Name of the HTML page. If the parameter is not specified then the maximum hit count of any of the pages is used.

width

Overal width of the graph.

height

Overal height of the graph.

axis

Axis parameter. Refer below.

only

Only is used to restrict the pages to one type for getting the maximum hit count. This can be set to one of the following

html

jpg

png

gif

txt

zip

css

nojpg

Do not use any ".jpg" or ".jpeg" files for getting the maximum hit count.

nopng

Do not use any ".png" files for getting the maximum hit count.

nogif

Do not use any ".gif" or ".giff" files for getting the maximum hit count.

notxt

Do not use any ".txt" or ".text" files for getting the maximum hit count.

nozip

Do not use any ".zip", "arj", "7z" or "z" files for getting the maximum hit count.

nocss

Do not use any ".css" files for getting the maximum hit count.

 

 

Graph Pages Axis parameters

Parameter

Description

type

This can be X or Y.

name

Name of the axis.

 

 

Action Email parameters

Parameter

Description

to

This is the destination email address.

 

 

 

 

Example of first HTML entry page

This creates the products. The products only need to be created once after a restart.

 

<html>

    <?Peasy products.create(code="MyCode1",price="US$100.00",name="Super Product",summary="Super product everyone needs",thumbnail="pic1.png") />

    <?Peasy products.create(code="MyCode2",price="US$200.00",name="Super Product 2",summary="Super product everyone absolutely needs="pic2.png") />

    <body>

        <?Peasy include(file="banner.html") />

        <?Peasy include(file="sidebar.html") />

        <p>We offer super products.</p>

        <?Peasy include(file="footer.html") />

    </body>

</html>

 

 

Example of first HTML entry page with product prices

This creates the products. The products only need to be created once after a restart. It also lists the products with its prices.

 

<html>

    <?Peasy products.create(code="MyCode1",price="US$100.00",name="Super Product",summary="Super product everyone needs",thumbnail="pic1.png") />

    <?Peasy products.create(code="MyCode2",price="US$200.00",name="Super Product 2",summary="Super product everyone absolutely needs="pic2.png") />

    <body>

        <?Peasy include(file="banner.html") />

        <?Peasy include(file="sidebar.html") />

        <p>We offer super products.</p>

        <p><a href="../cart.html?for=cart&add=MyCode1"> Super Product 1 costs <?Peasy products.text(code=SA-Win,attrib=price) />.</a></p>

        <p><a href="../cart.html?for=cart&add=MyCode1"> Super Product 2 costs <?Peasy products.text(code=MyCode2,attrib=price) />.</a></p>

        <?Peasy include(file="footer.html") />

    </body>

</html>

 

 

Example of cart.html page

This shows the customers shopping cart

 

<html>

    <body>

        <?Peasy include(file="banner.html") />

        <?Peasy include(file="sidebar.html") />

        <h2>Shopping cart contents</h2>

        <?Peasy customer.cart(nextpage=checkout.html,button="Proceed to checkout",updatebutton="Update",width=77,col(width=32,height=32,attrib=thumbnail),col(name="Product",width=150,attrib=name),col(name="Description",width=400,attrib=summary),col(name="Price",width=50,attrib=price),col(name="Quantity",width=50,attrib=quantity),col(name="Total",width=50,attrib=total)) />

        <br />

        <p> <font color="yellow">To remove an item from cart set the quantity to 0.</font></p>

        <br />

        <p>&nbsp;</p>

        <?Peasy include(file="footer.html") />

    </body>

</html>

 

 

Example of checkout.html page

This asks for the customers details

 

<html>

    <body>

        <?Peasy include(file="banner.html") />

        <?Peasy include(file="sidebar.html") />

        <h2>Checkout</h2>

        <p>Please enter the following details and press purchase</p>

        <?Peasy customer.details(nextpage=thankyou.html,button="Purchase",width=77,field(label="Your first name",attrib=name,required),field(label="Your family name",attrib=surname,required),field(label="Company / Organisation name",attrib=company),field(label="Your email",attrib=email,required),field(label="Credit card type",attrib=cctype.visa,units="Visa"),field(attrib=cctype.master,units="Mastercard",sameline=yes),field(label="Credit card number",attrib=ccnumber,units="(spaces permitted)",required),field(label="Credit card expiry",attrib=ccmonth,required),field(label="/",attrib=ccyear,required=yes,sameline=yes),field(label="Name on credit card",attrib=ccname,required),field(label="Credit card validation code",attrib=ccvalid,required,mask=8),field(label="Addition notes:",attrib=notes,multiline,cols=55,rows=8)) />

        <br />

        <p>&nbsp;</p>

        <?Peasy include(file="footer.html") />

    </body>

</html>

 

 

Example of thankyou.html page

This thanks the customer and generates the purchase

 

<html>

    <body>

        <?Peasy include(file="banner.html") />

        <?Peasy include(file="sidebar.html") />

        <?Peasy customer.save(file="C:\ProgramData\PeasyMailServer\orders.txt") />

        <?Peasy customer.email(to=sales@sartronics.com) />

        <h2>Thank you</h2>

        <p>Thank you for your purchase.</p>

        <p>We will be in contact you with.</p>

        <p>If you have any further quiries please refer to your purchase reference number <?Peasy customer.ref?>.</p>

        <br>

        <p>&nbsp;</p>

        <a href="index.html">Return to home page.</a>

        <?Peasy include(file="footer.html") />

    </body>

</html>

 

 

Example of banner.html page

This is the common banner page.

 

<style type="text/css">

    .banner_A{border-collapse:collapse;table-layout:auto;border: 0px solid #000000;}

    .banner_B{padding: 10px 10px 10px 10px;border-left: 3px solid #FF7FFF;border-top: 3px solid #FF7FFF;border-right: 3px solid #FF7FFF;border-bottom: 3px solid #FF7FFF;background-color:#FFFFFF;vertical-align:middle;background-image:url(marble.jpg);}

    .banner_C{font-family:Arial,Helvetica,sans-serif;font-size:32pt;font-weight:bold;font-style:italic;color:#0000FF;margin:0 0 0 0;}

    .banner_D{font-family:Arial,Helvetica,sans-serif;font-size:16pt;text-align:right;margin:5 0 5 0;}

    .banner_E{font-family:Arial,Helvetica,sans-serif;font-size:16pt;text-align:center;margin:5 0 5 0;}

    .banner_F{font-family:Arial,Helvetica,sans-serif;font-size:10pt;text-align:center;margin:5 0 5 0;}

</style>

<table width="100%" class="banner_A" style="margin: 0px 0px 0px 0px">

<colgroup><col width="100%"></colgroup>

    <tr>

        <td class="banner_B">

            <p class="banner_C">

                <img src="/banner_0.png" width="128" height="128" alt="banner_0.png">

                &nbsp;mywebsite.com

            </p>

        <p class="banner_D"><a href="index.html">foo.com</a> is the place for wonderful smiles&nbsp;&nbsp;</p>

        </td>

    </tr>

</table>

 

 

Example of sidebar.html page

This is the common sidebar page.

 

<div style="float:left;width:210px;">

    <style type="text/css">

        .leftside_A{border-collapse:collapse;table-layout:auto;border: 0px solid #000000;}

        .leftside_B{padding: 10px 10px 10px 10px;border-left: 3px solid #FF7FFF;border-top: 3px solid #FF7FFF;border-right: 3px solid #FF7FFF;border-bottom: 3px solid #FF7FFF;background-color:#FFFFFF;vertical-align:middle;background-image:url(marble.jpg);}

        .leftside_C{font-family:Arial,Helvetica,sans-serif;font-size:32pt;font-weight:bold;font-style:italic;color:#0000FF;margin:0 0 0 0;}

        .leftside_D{font-family:Arial,Helvetica,sans-serif;font-size:16pt;text-align:right;margin:5 0 5 0;}

        .leftside_E{font-family:Arial,Helvetica,sans-serif;font-size:16pt;text-align:center;margin:5 0 5 0;}

        .leftside_F{font-family:Arial,Helvetica,sans-serif;font-size:10pt;text-align:center;margin:5 0 5 0;}

    </style>

    <p class="leftside_F">&nbsp;</p>

    <table width="100%" class="leftside_A" style="margin: 0px 0px 0px 0px">

        <colgroup><col width="100%"></colgroup>

        <tr>

            <td class="leftside_B">

                <div class="leftside_E"><a href="/index.html">Home</a></div>

            </td>

        </tr>

    </table>

    <p class="leftside_F">&nbsp;</p>

    <table width="100%" class="leftside_A" style="margin: 0px 0px 0px 0px">

        <colgroup><col width="100%"></colgroup>

        <tr>

            <td class="leftside_B">

                <div class="leftside_E"><a href="/products.html">Products</a></div>

            </td>

        </tr>

    </table>

</div>

 

 

Example of footer.html page

This is the common footer page.

 

<style type="text/css">

    .footer_A{border-collapse:collapse;table-layout:auto;border: 0px solid #000000;}

    .footer_B{padding: 10px 10px 10px 10px;border-left: 3px solid #FF7FFF;border-top: 3px solid #FF7FFF;border-right: 3px solid #FF7FFF;border-bottom: 3px solid #FF7FFF;background-color:#FFFFFF;vertical-align:middle;background-image:url(marble.jpg);}

    .footer_C{font-family:Arial,Helvetica,sans-serif;font-size:32pt;font-weight:bold;font-style:italic;color:#0000FF;margin:0 0 0 0;}

    .footer_D{font-family:Arial,Helvetica,sans-serif;font-size:16pt;text-align:right;margin:5 0 5 0;}

    .footer_E{font-family:Arial,Helvetica,sans-serif;font-size:16pt;text-align:center;margin:5 0 5 0;}

    .footer_F{font-family:Arial,Helvetica,sans-serif;font-size:10pt;text-align:center;margin:5 0 5 0;}

</style>

<table width="100%" class="footer_A" style="margin: 0px 0px 0px 0px">

<colgroup><col width="100%"></colgroup>

    <tr>

        <td class="footer_B">

            <p class="footer_F">Copyright MyWebSite.com (2010)</p>

        </td>

    </tr>

</table>

 

 

Example of hit count statistics table page

This is page produces the number of hit counts, since the statistics were reset and a hit count table.

 

<h2>Pages Statistics</h2>

<p>

    Number of visitors <?Peasy stats.visits(type=all)/> since <?Peasy stats.since/> with a daily average of <?Peasy stats.visits(type=day)/>.

    The Server has been running since <?Peasy uptime />.

</p>

<h3>Web Pages Hit Counts</h3>

<p>

    <?Peasy stats.pages(col(name="Page Name",width=600,attrib=name),col(width=200,attrib=hitcnt,days=14),col(name="Average",width=200,attrib=hitcntav)) />

</p>

 

 

Example of a visitors table page

This is page produces the number of hit counts, since the statistics were reset and two visitors tables. One to show the number of unique visitors and one to show all visitors including webbots and local connections.

 

<h2>Visitors Statistics</h2>

<p>

    Number of visitors <?Peasy stats.visits(type=all)/> since <?Peasy stats.since/> with a daily average of <?Peasy stats.visits(type=day)/>.

    The Server has been running since <?Peasy uptime/>.

</p>

<h3>Browser Web Visitors</h3>

<p>

    Total count is <?Peasy stats.visitorcnt(only=browser)/>.

</p>

<p>

    <?Peasy stats.visitors(only=browser,col(name="Address",width=400,attrib=address),col(name="Name",width=600,attrib=name),col(name="Last visit",width=300,attrib=since),col(name="Visits",width=200,attrib=visits)) />

</p>

<h3>Web Visitors</h3>

<p>

    <?Peasy stats.visitors(norobot,nolocal,col(name="Address",width=400,attrib=address),col(name="Name",width=600,attrib=name),col(name="Last visit",width=300,attrib=since),col(name="Visits",width=200,attrib=visits)) />

</p>

<h3>Web Visitors (including webbots and local connections)</h3>

<p>

    Total count is <?Peasy stats.visitorcnt() />.

</p>

<p>

    <?Peasy stats.visitors(col(name="Address",width=400,attrib=address),col(name="Name",width=600,attrib=name),col(name="Last visit",width=300,attrib=since),col(name="Browser",width=100,attrib=browser),col(name="Robot",width=100,attrib=robot),col(name="Local",width=100,attrib=local),col(name="Visits",width=200,attrib=visits)) />

</p>

 

 

Example of hit count graph page

This is page shows then number of hit counts, since the statistics were reset and a hit count bar graph.

 

<h3>Web Pages Hit Counts Chart</h3>

<p>

    <?Peasy graph.pages(width=1000,height=600,x(label="Date from today"),y(label="Hit Count")) />

</p>

 

 

Back to Overview