Join Now

Click here to join our
growing community:



Welcome Tour
Pro Modules

Copyright © 2020
Terms of Use
Privacy Policy



BoltWire has prettys solid mail capabilities. Mail can be triggered by form commands or functions, though usually forms are used.

Several precautions are built to help you avoid sending unintended mail. First you must set the mode parameter. If not set to 'active', mail will operate in demo mode allowing you to test your settings. Once it appears to be working right, change the mode parameter. To turn off this requirement, set mailmode: active in site. config. All mail calls will skip the testing mode and go live immediately (unless you specify mode=demo).

To send mail via a function you must create a site.auth.mail page and define which pages can send mail this way. Be careful with enabling mail as a function. This is not required for form mail, but it can be used to tighten mail security for forms as well.

To send mail, the command requires the following fields: to, from, body. A simple mail form looks like this:

Email [text from]
Subject [text subject]
[box body col=40 rows=5][box]
[command mail mode=active]

In this case post values set the from, subject, and body fields. To is provide in the mail command itself. The mode is active. When the submit button is pushed, assuming proper values have been entered into the form, the email will fly off to the specific address.

"To" can be set as a parameter in the command/function, or as a post value in the form. If sitemail is set in site.config, it will default to that value. If BoltWire cannot find the receiver, mail will not be sent.

"From" is exactly the same. It can be set as a parameter in the command/function, or as a post value in the form. And if available will default to your sitemail config value. If BoltWire cannot find the sender, mail will not be sent.

Both the to and the from values can take either an email address, or if the user has an email data field on their member page, you can just use the member id. BoltWire will look up their email automatically.

Optional parameters can also be set such as reply or return. Both default to the from value.

The subject comes from either a parameter in the command/function, or as a post value in the form, or will default to "Mail from BoltWire". You can change the default subject by setting mailsubject in site.config.

The body is defined in either the parameter in the command/function, or as a post value. If set to a page name that exists in your installation, that page will be loaded as a template. You can also load a section of a page by setting Otherwise, the value of the command/function body parameter or post value is used.

If the command/function is in demo mode, it returns a bit of information about the email that would have been sent so you can verify everythng is correct. If the mode is active, it either sends the mail, or displays a message that your server is not configured properly to send mail. Note that mail is difficult to setup on a windows server--so this feature may not work on your localhost server. It should work fine when uploaded to the public web server.

Modifying the Message

Several template replacements can be inserted into the body of the message. Specifially, any parameter value from the command/function can be inserted by using {+field}. And simple variables can be inserted into your mail body if you are drawing it from an outside source.

You can (optionally) select certain markup rules to apply to your body tags by setting the content parameter to one of the followering. Or, specify which rules you want directly in the content parameter:

simple = vars,if,links
html = vars,if,links,fmt,block,style,end
all = vars,func,if,form,links,fmt,block,style,end

If the body ends up with any html tags, it attempts to send it as an html message. Otherwise, it just uses plain text. Be sure to test this carefully by sending messages to yourself, as this can produce unexpected results at times. The simpler your email body the better.