Active+ Software eMill Help Files

Welcome to the eMill® Help

Thanks for choosing eMill to create and manage your emailing projects.

To use this help file simply navigate the tree on the left or click on the index or search tabs. If you notice a feature not mentioned in the help files that you see in the application, do not hesitate to send us an email.

To contact us

Sales Department: sales@activeplus.com

Technical Support: support@activeplus.com

Help Files Main Sections:

eMill Overview
Start your Mailing Project
Using eMill
Publish your Mailing Project
Run the Mailer
Message Tracking
Fax
Server Side Scripting Guide
Server Side Scripting Samples
© eMill 2001-2015 . All trademarks property of their owners.


Requirements & Setup

1. Requirements

eMill requires various components of your Windows operating system as well as several modules that are part of Internet Explorer 6.0 or later versions. The eMill setup performs a check of your operating system and will either install or point you to missing resources.

Specifically, components and modules used are:

  • Operating System: Windows 2000, Windows XP, Windows Server 2003, Windows Vista, Windows 7, Windows 2008, Windows 2008 R2, versions 32-bit & 64-bit.
    Note: eMill Professional is the only edition that can be installed on Windows XP Home. The eMill fax add-on and the eMill web client cannot be installed on 64 bit operating systems.
  • Internet Explorer 6.0 or later: html viewer and editor.
  • Windows Scripting Host (WSH): VBScript engine (included with Windows 2000 and later).
  • Microsoft Data Access Component (MDAC): Must include as activeX Data Object (ADO) all the OLE DB providers for databases you may use (e.g. SQL Server or Oracle). Note that Jet 4.0 is required and is no longer included with MDAC version 2.6 and above (will be installed).
  • Programmers: If you are going to extensively use eMill's scripting features, you need either Visual InterDev or Microsoft's Script Debugger installed to debug your scripts (optional).
  • PDF format: You need Acrobat Reader® 5.0 or later installed to preview message content rendered in Portable Document Format (PDF). You can get the latest version from Adobe's website.
  • Embedded applications: Content files in popular formats sent out as email attachments (e.g. Word or Excel files) can be edited from eMill's Design Window provided the applications are installed on the machine.
  • eMill Fax: Microsoft Fax Service is necessary to use eMill Fax (will be installed).
  • Microsoft .NET Framework v2.0: required for the eMill Web Client (will be downloaded and installed during the setup).
  • Internet Information Services (IIS) 5.0 or later: required to install the message tracking redirector, to display the tracking statistics and for the eMill web client. IIS will be installed automatically by the setup program.

2. Setup

The eMill setup installs, depending on the edition you purchased, the eMill server, the eMill Windows client, the eMill Web client as well as the eMill Fax and eMill SMS add-ons.

  • Launch the eMill setup:
    - If you have downloaded the 'Self-extractible' file, double click on eMillEnterpriseSetup.exe or eMillProfessionnalSetup.exe.
    - If you have downloaded the 'Zip' file, unzip the eMillEnt.zip or eMillPro.zip folder and double click on setup.exe.
  • Welcome page: Start the setup by clicking on 'Next'.
  • License agreement: Read the license agreement, select 'I accept the terms in the license agreement' and click on 'Next'.
    If you want more details on the license agreement, do not hesitate to contact us.
  • Registration Key: Enter the Customer ID and the Customer Key we sent you when your purchased eMill.
  • Setup directory: By default, eMill is installed on C:\Program Files\Active+\eMill.
  • Setup Type: eMill is composed of a server to render, send and receive messages and of an eMill client to create and manage the projects.
    If you install eMill for the first time, select 'eMill Server and its components' to launch a full setup. If you only want to install an eMill Windows client to connect to an existing eMill server (through the local or remote network), select 'eMill Windows Client' and enter the local or remote network name of the machine where eMill Server is running.
  • eMill Server Components: Select the components you want to install:
    - eMill Server: Render, send and receive message. It is mandatory.
    - eMill Windows Client: Create and manage eMill projects. It is mandatory.
    - eMill Web Client: Create and manage eMill project from anywhere through any web browser. IIS (Internet Services) is necessary to run the Web Client. This component is automatically installed by the eMill setup. However, it is not available with the Windows Home Editions.
    - eMill Fax add-on: Broadcast and manage fax mailings. The Windows Fax Service is necessary to run the eMill Fax add-on. This component is automatically installed by the eMill setup.
    - eMill SMS add-on: Manage SMS mailings and broadcast campaigns by connecting to external SMS providers.

Connectivity is the other important issue prior to starting. If you want eMill to interact with other systems on the local or remote network, make sure that you have proper access to the Internet and / or user rights to specified databases located on other networked machines. Contact your network administrator if any required access is denied.

Remote connection to an eMill Server: If you want the eMill Server to be accessed remotely by eMill Windows Clients, you must open the TCP port 2156 on the machine where eMill Server is running. On Windows XP SP2 or Windows 2003 (Windows firewall) a firewall exception named 'eMill' which opens the port 2156 is automatically added by the eMill setup.
© eMill 2001-2015 . All trademarks property of their owners.


eMill Overview

The three key steps to create an emailing project

Design | Publishing | Sending
  • Creating your message content
  • Editing your receivers lists
  • Editing your black lists
  • Customizing your emailing project
 Once the project is ready to be sent, the next step consists in uploading the project files to the eMill Server (this step is also required when the server is on the same machine) This last step is accessible through the Queues window. From this window, you can generate messages for each receiver, send messages and control received messages.
eMill Client | eMill Server

1. Design

  • Editing the message content : eMill features a built-in editor that lets you create the message body in the two formats supported by Internet mail clients: HTML and Text. The editor generates all the common html tags required to easily achieve appealing layouts. Contents can also be edited by using your preferred application.
  • Editing your receivers lists : eMill can link to most databases formats installed on corporate, office or personal systems. Alternatively, eMill lets you create a new project-specific database, import addresses from the clipboard, or from unformatted files. The editor lets you add, modify or delete individual records.
  • Personalization : They are three ways to personnalize a mailing project:
  • Inserting fields from your receivers list
  • Enabling contents based on receivers records

  • Inserting server side scripts

  • Script editor : eMill implements script events that can be used to perform advanced customization on your mailing projects.

2. Publishing

Designing a project, eMill generates a project tree and saves files in popular formats (txt, html, vbs, mdb...). Collaborative work, including use of external applications, is allowed at design stage. After completing design, the publisher makes an image of all files that will be used for the mailing inside a new tree, and generates the transmission queues (message folders). Once a project is published, it is in a delivery pending status and cannot be edited from the published tree. Modifications need to be made from the design tree, and the project published again.

3. Sending

This stage is managed by two components:

  • Render: The render merges together all the files, prepares the headers, encodes the content in MIME format, converts attachments to PDF (optional), and generates the email files (EML) inside the message outbox.
  • Mailer: This component performs message delivery, displaying progress in the queue window in real time. You can control transmission: pause, abort, restart, schedule - and check the statistics after completion. Delivery can be done directly to each recipient's mail server or can be relayed to external or corporate SMTP servers, and load-balancing settings are provided.

eMill components

  • eMill Server: This process (emillsrv.exe) renders, delivers and retrieves email. It runs in the background as a Windows Service. It is logged on using the LocalSystem account with automatic startup. eMill Server acts as a server, allowing other eMill users on the network to publish their project onto the machine, according to their permissions. You can manage the eMill Server service through the Services Windows administrative snap-in.
  • eMill Redirector: This component is an autonomous module in form of an ISAPI extension that must be installed on a public Microsoft Internet Information Server (IIS). When the message tracking is activated on a site or virtual folder, the eMill Redirector logs and redirects http requests originating from email recipients. These logs are then collected by the eMill Server for further analysis.
  • Fax: The eMill Fax module enables you to integrate the sending and the reception of faxes into the heart of your mailing projects and to combine email mailing and fax mailing efficiently. eMill Fax can also route incoming faxes directly to your email mailbox in PDF or Tiff format.

© eMill 2001-2015 . All trademarks property of their owners.


Start your Mailing Project

To create a new mailing project, you can:

  • Run the New eMill Mailing Project wizard, you will be prompted through various screens to define the project basics. All settings and parameters created by the wizard may be changed later at any time. If you want to create the project contents based on an email you already have, the wizard lets you specify an optional message template.
  • Duplicate an existing project using the Duplicate Project As option from the File menu.
  • Create a new empty project

Once your new project is created, you may add a new content by using one of the eMill editor or by using your preferred application. If you want to import an existing file, use the create a new content from an existing file option.

© eMill 2001-2015 . All trademarks property of their owners.


Starting a new project

Starting a new project creates a project file (the .mil file) that records the location and name of all resources you will link the project to. Therefore, it is recommended to start using this option.
  • From the File/New menu, select the new Mailing Project option, click OK:

The next 3 dialog boxes will create the project tree with editable content files, and establish a connection between your project and the data source supplying the records (mailing lists and content variables).

  • Name your project, validate the default path or browse for new one, click Next:
  • Enter the From field: the mailing sender's name and email address that recipients will see.
  • Enter a subject for the email, click Next:
  • Data source settings:
    The wizard will now ask for a receivers data source in order to generate the mailing list. Several options are available, from linking to a data source (Oracle, SQL Server, Excel, Access, Address Book or Outlook Contacts) to importing addresses from files / from the clipboard, connecting to a XML Data Source (XML ADO format) or to starting a new project database. If you are visiting for the first time, you may check the last option I don't have a database, create one for me, which will complete the wizard's job and let you create the contents.
  • Select your database tables and queries: See Editing the Records
Email address format: Use the following syntax to enter addresses:
"The Name" <xyz@anything.com>
or click on the button adjacent to the text field to use the 'Email Address Formatter'.

Empty mailing project:

This option bypasses the wizard and lets you directly generate the project folder, default milset.vbs and .mil files. You can specify later the content files and data source you want to use.

© eMill 2001-2015 . All trademarks property of their owners.


Starting a new content file

Content files are used to generate the message body and / or attachments. Modern email clients can display either text or html content.
  • From the File/New menu, select the new HTML File or the new Text File option, click OK:
A new file is displayed in eMill's content editor. Since the file is not yet linked to any project, some editor functions will not be available.
Including the file into a project: To benefit from all features and have the file displayed from the project design window, save the file to your project folder and include it to the project using the new content from an existing file option.

© eMill 2001-2015 . All trademarks property of their owners.


Starting a new script file

eMill provides server-side scripting features that you can optionally use to highly personalize the message content, or to integrate your email channel with other corporate software. The scripts are not sent along with the message, but executed by the server that uses them to generate some of the content. You can include the scripts into the message during the content creation or insert them afterwards. Creating your scripts independently from the content is useful if the content layout, graphics and the writing originate from another source (e.g. graphics or marketing departments).
  • From the File/New menu, select the new Script File option, click OK.
A new script file is displayed in the text editor window. You can start editing the script.
Including the script into a project: Open the content file that will include the script from eMill's design window, and paste the script inside the insert script text area.

© eMill 2001-2015 . All trademarks property of their owners.


Using a template

You can start a new project from an existing template file. By specifying that file as a template, eMill will extract editable content files of the message and save them to the project folder, ready for edition. This feature is useful if you wish to work from formerly received or issued emails that include numerous content files with complex layouts.
  • From the File/New menu, select the new Mailing Project option, click OK:
Name your project and select the template you wish to use.

Note: You may create your own templates using any software which can create MIME encoded files (e.g. Outlook Express). Templates are located in the \Program Files\Active+\eMill\Templates folder.

© eMill 2001-2015 . All trademarks property of their owners.


Set the Mailing Options

Set the eMill Options

The eMill options dialog contains all the non project specific settings:

- General options: Configures the user interface related preferences.

- Mailing defaults: Configures the default mail headers for newly created projects (From, Reply-To etc.).

- Outgoing queues: Configures the outgoing SMTP relay servers.
- Incoming queues: Configures the incoming POP3 accounts where eMill should look for incoming messages (e.g. responses to sent messages). You will then need to subscribe your projects to these queues and define rules to execute on these messages.

- Advanced options: Configures DNS servers and settings related to the SMTP protocol.

- Accounts: Configures what permissions eMill users have over their mailing projects once published on the server.
- Message tracking : Configures urls and account settings to access the message tracking redirector.

- S/MIME: Configures various settings regarding the sending of certified and secure mails.

- SMS: Configures all settings used to send SMS.

- Fax : Configures the eMill Fax module general settings (incoming routing, quality,...).

- Store : Configure the messages and statistics store.

- DKIM Keys : Configure the DKIM keys.

WARNING: Legislation was passed in some countries or states to protect privacy and provide enforceable laws governing the commercial use of email. Be aware there are numerous regulations in certain geographic areas concerning:
  • Unsolicited email (UCE)
  • Opt-out provisions
  • Accurate sender name and router information
  • Misleading information inside headers
  • Compulsory codified labels in subject
  • Point of origin and transmission path information
  • Legal name and physical address of sender
  • Date and time stamping on message
  • Content restrictions (e.g. sexually explicit materials, other...)
  • Use and storage of digital information about individuals
  • more...
Be aware that your legal requirements may exceed those imposed by your local law. If you are conducting mailings over geographical areas you are not able to determine precisely, it is safer to use as guidelines a combination of the most restrictive laws.

© eMill 2001-2015 . All trademarks property of their owners.


Setting the general options

  • From the Tools/Options menu, click on the General tab:
  • Check the eMill startup options you wish.
  • Check the automatic reload option to reload the editor with the most recently saved files: eMill does not lock files when opened inside its editors to allow teamwork.
  • Check the Add date and time if you want all events written to the script log to include a date and time stamp.
  • When double clicking : sets the preferences when double clicking on a record from the receivers view. You can edit the record or preview the message for the recipient on record.

© eMill 2001-2015 . All trademarks property of their owners.


Setting the mailing defaults

Anti-spam filters may compromise delivery of your messages if the following informations are incorrect or missing. The Mail From address must be considered compulsory.
  • From the Tools/Options menu, click on the Mailing Defaults tab:
  • Enter the From address: the sender's email address (similar to above, or see footnote).
  • Enter the Reply-To address: the email address to which replies are delivered. You do not need to specify a reply to address if it is the same as the From address.
  • Enter your Organization or name, as it will appear in the header.
  • Select the message content Charset: Should be recognized by eMill from your system settings. If your message includes several contents with different languages, define a different charset in each content properties. If your message includes several languages in one content, select the Unicode UTF-8 from the scroll down list.
Email address format: Use the following syntax to enter addresses:
"Name" <xyz@anything.com>
or click on the button adjacent to the text field to use the 'Email Address Formatter'.

© eMill 2001-2015 . All trademarks property of their owners


Setting the outgoing queues

In order to send messages you need a SMTP server that handles email transport on the Internet. eMill lets you use external servers to deliver your mailing. The Built-in mailer provided with eMill is an SMTP relay server, which is only able to send and not receive email. The Built-in relay server feature is also known as 'Direct Send' or 'Direct Delivery' feature.
  • From the Tools/Options menu, click on the Outgoing Queues tab:

  • Check / uncheck the Simulate box to test the mailer process. The SMTP session will be started and a RSET command sent to abort transmission. Messages will appear as having been sent in the mailing queues, but recipients will not receive anything.

Adding a server:

  • Click on Add button. The Add an outgoing queue dialog box appears:

  • Check / uncheck the Enabled box to add the server to your outgoing server pool. Several servers can be enabled for a mailing and the load balancing is determined by throughput capacity, the connection count.
  • Enter a unique Queue name to identify this outgoing queue.
  • Enter a Connection Count: this setting determines the maximum number of simultaneous connections between eMill and the server. To optimize, start with 1 and raise the value over time until you reach any limit with your server or bandwidth. 14 should reflect fair bandwidth and server performance when using a relay server, 50 should give good results when using direct delivery method. Too high a value could be counterproductive.
  • Check Direct Delivery to send message using the eMill intergrated SMTP server. Some limitations may apply to the use of the builtin-in SMTP server, please refer to the online FAQ section.
  • Check Use SMTP Relai Server to send message using an external SMTP server. This may typically be your company SMTP server or your Internet Service Provider SMTP server.
  • Enter the relay Server name (i.e.: smtp.domain.com) or the relay server IP address.
  • Enter a Port to connect to the relay server. The standard port for SMTP is 25. Note that Port 587 is widely used because port 25 is often abused by malware to spread worms and spam.
  • Select the Authentication method and enter the login information.
    • None: Most used method. This method applies when you don't need a login and password to connect to the SMTP Server. It identifies you by detecting your IP address or the domain name of the message sender.
    • Basic (Login): This method applies when the SMTP server identifies you by using a login and a password without encryption.
    • POP3 Login: This method applies when the SMTP server checks if you open successfully a POP session before allowing an SMTP session.
    • Windows Security (process account): This method applies when you use the account on which eMill server runs (by default, the system account) to be identified by the SMTP Server.
    • Windows Security (specific account): This method applies when you use a specific Windows account to be identified by the SMTP Server. When you want to connect to an Exchange Server, you must select this method and enter a user account (login & password) that is known to Exchange Server.
    If you don't know which authentication method to use, please contact your network administrator.

Advanced settings:

  • Click on the Advanced tab:

  • The Host Name field contains the value that is transmitted during the SMTP connection. If this value is empty, the full machine name (FQDN) is used instead. When using the Direct Delivery mode, this name should match the reverve IP resolution name.
  • The IP Binding list can be use to specify the IP address that will be used to send messages. By default, the address is automatically selected. When eMill is installed on a server machine with several IPs, it may be necessary to specify the sending IPs.
  • The Maximum message sent per minute limitation can be use to limit the message throughtput. Some Internet Service Provider impose this kind of limitation to use their relai SMTP server.
  • When the Maximum message sent per session option is enabled, eMill will close the connection when the specified message count has been sent, for each connection to the SMTP server. Note that this option doesn't have any effect when using the Direct Delivery mode.

Modify a server:

  • Select a server from the list and click on Modify.
  • Modify the information from the Modify outgoing queue dialog box (refer to procedure above).

Removing a server:

  • Select a server from the list and click on Remove.
Security: Some email servers implement various strategies to limit the risks of improper use (e.g. successfully opening a POP session before allowing an SMTP session). Check with your network administrator if you are experiencing problems with your outgoing queues.

© eMill 2001-2015 . All trademarks property of their owners.


Setting the incoming queues

eMill lets you collect and process responses to your mailings or any other kind of email inputs. For this, you need to follow 2 steps:

- Setting the incoming queues: In order to receive messages you must create an incoming queue which will be associated with either a POP3 account or a path where received mails are stored in MIME format.
Example: If you send your mails with an address like sales@yourdomain.com then you need to configure the POP3 details for the sales@yourdomain.com account.

- Associate your published mailing project with an incoming queue: Once your project is published, you need to associate it with one or more incoming queue.

- Incoming message Processing: You will then need to decide what actions to perform on your received mails (update a database, move it to a specific folder, delete it, manage subscriptions/unsubscriptions, etc.).

  • From the Tools/Options menu, click on the Incoming Queues tab:

Incoming queue list:

The list window displays all current incoming message queues with their status and settings.

Adding a new incoming message queue:

  • Click on Add. The Incoming Message Queue dialog box appears:
  • Enter a Name for the queue and a Polling interval (frequency at which emails are retrieved). The name will help you identify the source when you will subscribe your project to incoming queues.
  • Select a method: POP3 access or Path to message files (see footnote).

Modifying an incoming message queue:

  • Select a queue from the list and click on Modify.
  • Modify the information from the Incoming Message Queue dialog box (refer to procedure above).

Removing an incoming message queue:

  • Select a queue from the list and click on Remove.
POP3 or Path methods: If you are using an external mail server to host your email replies mailboxes, use the POP3 connection, providing the same settings you would use to download messages from your email client. If the mail server is on the same machine as the eMill Server machine, it is much more efficient to directly provide the path to the email files. See your network administrator to see if your mail server offers a way to access email files directly.
Local DSN : This incoming queue aims at receiving notifications when you use the built-in SMTP server and when eMill aborts the sending of a message. To create these notifications, you must also check the 'Create local delivery notification' option in the Mailer DSN properties.
© eMill 2001-2015 . All trademarks property of their owners


Setting the advanced options

The following settings let you specify network information for the mailer. A wizard will detect the DNS server from your dialup settings and switch to Active+ Software's DNS if none can be found. You can still opt to enter a specific server.
  • From the Tools/Options menu, click on the Advanced tab:
  • DNS Server(s)
    Use network default: Select this option if you want eMill to detect the network DNS server from the computer settings.
    Use specific: Enter the DNS server IP address (see footnote).
    Use Active+ Software...: Select this option if you do not have a DNS server.
  • Enter in the Reverse IP Name field the name that is returned when you perform a reverse IP query on the public IP of the eMill Server machine. It is very important to enter this field with the correct value if you use the built in SMTP server. Not entering the correct value may result in your mails being detected as SPAM. This information is also passed to the receiving SMTP server after the HELO or EHLO command of an opening SMTP session. In some cases, the receiving server will check the information you supplied either by solving the domain name and matching the IP addresses, and/or by attempting a handshake with the declared server to prove its existence. If either fails, the SMTP sender is considered suspicious and the connection will be denied. If you have not supplied an SMTP domain and are using eMill's built-in mailer as the SMTP mailer, the mailer information defaults to the computer identification on the network.
  • You can have the eMill SMTP relay reply to HELO commands by checking the Respond to incoming SMTP requests (see footnote).
Setting the DNS server address: The DNS server is used to solve the recipient domains. eMill will look up your TCP/IP connection settings and present you with the address found. If it fails to do so, you can find the DNS server address from your current internet connection properties supplied by your internet access provider. If your machine resides on a corporate LAN, ask your network administrator for your company's DNS server address.

© eMill 2001-2015 . All trademarks property of their owners


Setting the user accounts

eMill Enterprise and eMill Service Provider editions give access to account administration features to define what permissions other eMill users have over mailing projects. Such features are useful for collaborative work on shared projects and for offering email marketing services. Note that the eMill Service Provider edition includes specific modules for accounting and credits management.

When installing eMill Enterprise and eMill Service Provider editions, an eMill Server is installed on the local machine, is made available to all other machines through the local network or the Internet and is accessible through a Windows or a web interface. eMill thus acts as a server application relative to other eMill machines, and as a client of all other eMill machines as well.
  • From the Tools/Options menu, click on the Accounts tab:

Accounts list:

The list window displays all groups of users having rights to the eMill server installed on the local machine. Note that rights administration to an eMill server can only be performed from the local machine.

When installing eMill, a Users group is created by default, that grants all rights to other networked users also running eMill (NT authenticated users). To restrict use of an eMill server to a selection of eMill clients, you need to delete this account and add new ones.

Adding a new account:

  • Click on Add. The Add account dialog box appears:
  • Enter a Name for the new user or group of users and a description.
  • Complete the Account manager contact details. This information is not mandatory but it is stored in the Account database and can be accessed by script in order to produce reports for each account manager.

Assigning permissions to users:

Click on the Security tab. The current local user (Windows Login) is displayed by default, with all permissions granted.
  • Click on Add to assign additional users to the eMill server account:
The list of all groups and users of all domains is displayed. To add a user, highlight it in the list, click on Add and OK
  • Define the permissions by checking the appropriate box(es):
    • Create and delete projects: The user or group of users can display all the modules and save all modifications.
    • View projects: The user or group of users can display all the modules of the project except the message queues and the message tracking statistics. He cannot save any modifications made in the project.
    • Modify projects: The user or group of users can display and save modifications on all the modules of the project except the message queues and the message tracking statistics.
    • View queues messages: The user or group of users can only display the messages in the queues.
    • Render and delete queues messages: The user or group of users can display the messages in the queues, render messages and delete messages.
    • Start and stop mailer: The user or group of users can display the messages in the queues, start and stop the mailer.
    • View message tracking statistics: The user or group of users can display the message tracking statistics but cannot reset them.
    • Reset message tracking statistics: The user or group of users can display the message tracking statistics and reset them.
    • Create and delete shared lists: The user or group of users can create new shared list and delete account shared lists.
    • Modify shared list records: The user or group of users can modify records of account shared lists.
  • Use the following account to run background tasks: eMill needs an account to run some tasks (processing of incoming messages, message rendering). In order to secure the running of these tasks, it is recommended to specify an account with limited rights. If you do not check this box, the default account is the one used to access the eMill server (default system account).

Define restrictions to users:

Click on the Restrictions tab.
  • Allowed Features: Choose the features that will be made available to the user or group of users.
    • Send emails: The user can broadcast messages by e-mail.
    • Message tracking: The user can activate the tracking of sent emails. Permissions to view and/or reset the tracking statistics must be set in the Security tab.
    • Send Fax: The user can broadcast messages by Fax.
    • Send SMS: The user can broadcast messages by SMS.
  • Incoming queues: The user or group of users will have the possibility to subscribe to the incoming queues define below. Note that incoming queues must first be configured in Tools/Options/Incoming Queues.
    • Allow access to all queues: The user can subscribe to all the incoming queues configured in the Tools/Options/Incoming Queues menu.
    • Allow access to the following queues: Check the box(es) corresponding to the incoming queue(s) that will be made available to the user or group of users.

Specify limitations for users (only available with eMill Service Provider Edition):

Click on the Limitations tab. To enable a limitation, check the corresponding box and define a parameter in the text area.
  • Maximum mailing project per account: Lets you limitate the number of mailing projects per account. For instance, if you enter "1", the user(s) will only be able to create one mailing project.
  • Maximum messages per render: Lets you limitate the number of messages per render. This limitation aims at specifying the maximum number of messages per campaign. If a render exceeds the maximum number of messages, the message rendering will be aborted when the limit is reached.
  • Maximum message size: Lets you limitate the size of sent messages. If a user tries to send a message that exceeds the maximum size, the message rendering will be aborted and a note will be added to the project log with the receiver's e-mail address, the message size and the maximum message size.
  • Maximum messages sent per minute: Lets you limitate the number of messages sent per minute in order to avoid the overloading of your SMTP server.

Configure accounting for users (only available with eMill Service Provider Edition):

Click on the Accounting tab.

The accounting module aims at giving you a tool to monitor the activity of an account. It can also be used to manage easily the invoicing as the value of each variables (sent messages, rendered messages, outgoing traffic, etc.) is expressed in credits.

In order to configure the Accounting, you must follow 2 steps:

  1. Creditable values: Define what is the value of each variable. For instance, "count 5 credits for each sent emails". To set a value, select the variable type in the table and click on Edit.
    • Sent emails: For each sent email, define the number of credits that will be counted. You are also able to count additional credits if the size of sent messages exceeds a limit.
      Example: You want to count 5 credits for each sent email and additional credits for each slice of 500 KB if a message size exceeds 500 KB. If the user sends 8 messages of 400 Ko each and 2 messages of 600 KB. The number of credits will be counted as follow:
      - Sent emails: 10 messages x 5 credits = 50 credits
      - The size of 2 sent emails is 600 KB and exceeds the 500 KB limit. For each of these emails, 5 additionnal credits will be counted: 2 messages x 5 credits x 1 slice = 10 credits.
      - The total number of counted credits will be 50 + 10 = 60 credits.

    • Sent faxes: For each sent faxes, define the number of credits that will be counted.
      Example: You want to count 5 credits for each sent faxes. If the user sends 10 faxes, the number of counted credits will be 10 faxes x 5 credits = 50 credits.
    • Sent SMS: For each sent SMS, define the number of credits that will be counted.
      Example: You want to count 5 credits for each sent SMS. If the user sends 10 SMS, the number of counted credits will be 10 SMS x 5 credits = 50 credits.
    • Rendered messages: For each rendered message, define the number of credits that will be counted. You are also able to count additional credits if the size of rendered messages exceeds a limit.
      Example: You want to count 5 credits for each rendered messages and additional credits for each slice of 500 KB if a message size exceeds 500 KB. If the user sends 8 messages of 400 KB each and 2 messages of 600 KB. The number of credits will be counted as follow:
      - Rendered messages: 10 messages x 5 credits = 50 credits
      - The size of 2 rendered messages is 600 KB exceeds the 500 KB limit. For each of these messages, 5 additional credits will be counted: 2 messages x 5 credits x 1 slice = 10 credits.
      - The total number of counted credits will be 50 + 10 = 60 credits.
    • Outgoing traffic: Define the number of credits that will be counted according to the total size of sent messages.
      Example: You want to count 5 credits for each slice of 100 KB. If the user sends 500 KB (10 messages of 50 KB each), it means that there are 5 slices of 100 KB and the number of counted credits will be 5 slices x 5 credits = 25 credits.
  2. Accounting values: This presents an overview of the different variables value. You are also able to see the total of counted credits at the bottom of the table according to the settings configured in "Creditable values".
    • Sent emails: Gives you the number of sent emails since the last reset.
    • Sent faxes: Gives you the number of sent faxes since the last reset.
    • Sent SMS: Gives you the number of sent SMS since the last reset.
    • Received messages: Gives the total number of received messages on all mailing projects of the account since the last reset.
    • Rendered messages: Gives the total number of rendered messages on all mailing projects of the account since the last reset.
    • Outgoing traffic: Gives the total size of sent messages on all mailing projects of the account since the last reset.
    • Incoming traffic: Gives the total size of received messages on all mailing projects of the account since the last reset.
    • Credits: Gives you the total number of counted credits according to the settings configured in "Creditable values" since the last reset.
    • Refresh: Click here to refresh the accounting values table. Note that this operation cannot be cancelled.
    • Reset: Click here to reset all the accounting values.
    • Report: Click here to create a report as an Excel or CSV file. The report gives you the details of all the above accounting values per day. It can be useful to monitor the activity of an account and to generate the invoices for your client as it gives you the number of counted credits per day.

© eMill 2001-2015 . All trademarks property of their owners.


Setting the Tracking Options

Message tracking is done through one or many eMill Redirectors running on public web servers. The eMill Server downloads on a regular basis tracking logs that were collected by different eMill Redirectors.

  • From the Tools/Options menu, select the Tracking tab:

Tracking redirectors list:

The list window displays all the configured tracking redirectors and their working mode.

Adding a new tracking redirector:

  • Click on Add. The Redirector properties dialog box appears:
  • Select a Working Mode. This can be Redirection and Collect if the redirector is active and must be used to track messages, Collect only if the redirector must no longer be used to track message, but was used and still gather tracking data, or Disabled.
  • Specify the Redirector type. New ASPX and PHP redirectors are version 2. Tracked URLs for version 2 redirectors are compressed and encoded. To allow compatibiliy with older eMill version, redirectors version 2 are able to work like redirectors version 1 on Linux.
  • Enter the Redirection URL. This is the URL of the web site or virtual folder where the eMill Redirector is running, accessible from the Internet.
  • Enter the Collect URL. This is the URL of the web site or virtual folder where the eMill Redirector is running, accessible from the eMill server machine. In most cases, this URL is the same as the Redirection URL.
  • Enter the Domain, User Name and Password fields of the collect user account used to secure the connection. The Domain field is required only for redirector version 1 running on Windows. It can be replaced by a dot or the Windows machine name if the collect user account is not part of a Windows NT domain.
  • If there is multiple redirectors working in Redirection and Collect mode, you can specify a coma separated list of Domain affinity Patterns (a pattern is a string that can contain ? and * jokers). When a tracked message is rendered, if the sender domain match one of the domain affinity patterns, this redirector will be used in priority.

Modifying a tracking redirector:

  • Select the redirector to modify and click on Modify. The Redirector properties dialog box appears.
  • Modify the information from the Redirector Properties dialog box (refer to procedure above).

Set a tracking redirector as default:

  • Select a redirector working in Redirect and Collect mode and click on Set as Default. This redirector will be used by default to track message URLs when no domain matching affinity is found.

Removing a tracking redirector:

  • Select a redirector and click on Remove.
Note: if no redirector is working in Redirect and Collect mode, the tracking is assumed to be disabled. Any render of messages with the tracking enabled will fail and return Tracking not configured error.
© eMill 2001-2015 . All trademarks property of their owners.


The S/MIME options

Setting the S/MIME options

S/MIME allows you to send secure messages to your distribution list. Thanks to digital signature, receivers have a guarantee of the origin and the integrity of the message. Encryption offers you the possibility to send sensitive informations (confidential data, comercial or bank statements, etc.).

In Windows, certificates are gathered together in stores. In order to display a list of stores and installed certificates, open a new MMC and add Certificates, a snap-in software component.

Note: Each certificate includes 2 keys: a private and a public one. Digital signature needs the use of the sender private key. Encryption needs the use of the receiver public key. In order to determine which certificate has to be used to sign messages, eMill checks the sender email address. In order to determine which certificate has to be used to encrypt messages, eMill checks the receiver email address.

By default, a certificate blocks the direct access to its private key. If you want eMill to use a certificate to sign messages, you must authorize the access to the certificate private key. Thus, you need to export your certificate (disable private key strong protection) and import it in the store you choose.

eMill Server is a Windows service, it cannot access to certificates stores which are in the computer account.
© eMill 2001-2015 . All trademarks property of their owners.


Set the SMS options

Setting the SMS options

The SMS options let you configure all settings used to send SMS.

  • From the Tools/Options menu, click on the SMS tab:

In order to send SMS, you must first tell eMill which Short Message Service Center (SMSC) you want to use. A SMSC provides the routing of all SMS to the recipient mobile phones. Therefore, before sending SMS from eMill, you will have to subscribe and buy credits from a SMSC.

The table of the available SMSCs is divided into 2 columns, the SMSC name and its type. Two types of SMSC are currently supported:

  • Email to SMS Gateway: eMill is already configured for the TM4B Email to SMS Gateway. In order to use this provider, you must follow these steps:
    1. Create an account: Go to http://www.tm4b.com and create an account by clicking on 'Register Online'.
    2. Grant permission to the Sender Address: The 'From' address that you will use for sending SMS (Project > Properties > Header) must be granted within your TM4B account. For granting permission, sign in online in your TM4B Account and go to Settings > SMS API. Under SMTP Access, enter the email address and a password.
    3. Configure it within eMill: In the Available SMSCs table, select TM4B, click on Activate and on Properties. Enter the login of your TM4B account and the password which is associated with the sender email address (see step 2). Note that the Sender Address can be modified if you have a TM4B Short Code (used to receive SMS).
    Please contact us, if you want to use another Email to SMS Gateway.
  • SMPP: Two SMPP servers are listed in the Available SMSCs table. "World-Text" and "Other SMPP Server" that lets you configure by yourself any other SMPP Server. In order to use World-Text, you must follow these steps:
    1. Create an account: Go to http://www.world-text.com and create an account by clicking on My Account > Register.
    2. Configure it within eMill: In the Available SMSCs table, select World-Text, click on Activate and on Properties. Enter the login and the password of your World-Text account. All other parameters are already filled in. If you have any problems, you can find all the details for configuring your access to World-Text by signing in online in your World-Text Account and clicking on 'SMPP Integration Documentation'. Note that the Sender Address can be modified if you have a World-Text Short Code (used to receive SMS).

Note that choosing between the 2 types of SMSCs will mainly depends on the price and the way you want to use the SMS channel (volume, send & receive SMS,...).

© eMill 2001-2015 . All trademarks property of their owners.


Set the Fax options

Setting the Fax options

The Fax options let you configure all settings used by the eMill Fax module. You can also configure for each fax capable devices the incoming fax routing options.

  • From the Tools/Options menu, click on the Fax tab:

  • Postmaster: This email address is the originator address (the From) used by the Fax gateway when a delivery status notification (DSN) message is sent.

  • Default Cover Page: Select here the cover page that will be used when sending faxes. Click on Edit to modify the cover page using the Microsoft Cover Page Editor. It is not compulsory to specify a default cover page because you can also create one directly in your mailing project as the message body.

    If you choose to set a default cover page, the fields will be completed as follow:

    1. Cover page fields regarding the sender (company name, address, fax number, etc.) will be completed using the informations indicated in the Microsoft Fax Console settings (Tools > Sender Information).

    2. The following cover page fields are dynamically filled in by eMill:

    - Recipient's Name: completed dynamically for each receiver if you have specified the FirstName and/or LastName field in the receivers list properties. If not, eMill will insert the receiver fax number.

    - Recipient's Fax #: the receiver fax number is completed dynamically for each receiver.

    - Date/Time Sent: completed dynamically.

    - # of Pages: the number of sent pages is completed dynamically.

    - Subject: completed with the subject indicated in the header properties or in the Mail_OnStart() script function.

    - Note: In order to insert a text in this field, you need to create a text file and place it at the first place of the contents list (see content positionning). If you have a HTML content and an alternate Text content, the Note field will be completed with the Text content and the HTML content will be ignored for fax rendering.

  • I mage quality: Select here the desired Fax quality. Selecting "Draft" (200 x 100) will produce smaller Fax images and therefore will reduce the cost and time of sending faxes.
    If you use the "Draft" quality and you send out PDF documents, make sure to install Acrobat Reader 6.0 or later.
  • Fax Devices: Displays the list of available fax devices. The Properties button will show settings regarding the reception of faxes. See below for details.
  • Dialing:

To access an outside line using a dialable number, dial: Enter in this field any prefix that may be needed to access an outside line (PBX prefix, etc.)

Test Number: Enter here a canonical number that you wish to see in its dialable form (e.g. +1 (212) 555-1212 will result in 5551212 if you are in NYC)
Rules: This button is used to configure the Windows dialing rules settings. Refer to the Windows documentation for details.

Incoming Fax Properties

This dialog box lets you configure Fax routing settings used when a Fax is received.

  • Forward to the Fax incoming queue: When this option is checked, received faxes will arrive in the incoming Fax queue. In order to have the received faxes in the Inbox folder, your mailing project needs to be subscribed to the Fax queue. See the Incoming Message Processing for details.
  • Forward using SMTP: When this option is checked, received faxes will be forwarded to the email address that you specify in the To field.
  • From: Enter in this field the email address of the sender associated with the receiving fax device.
  • To: Enter in this field the email address of the contact who will receive incoming Faxes.
  • Format: Select the format in which you would like to read your faxes: PDF (Adobe Acrobat) or TIFF (image format).
  • Include thumbnails of the first four pages: When this option is checked, the email body will contain thumbnails of the received faxes. This feature is useful to quickly sort out faxes without having to open them in the Fax viewer.
  • Raw format (no message body, attachment only): This advanced option lets you forward the fax without adding any body to the message. This feature is useful to implement Fax forwarding to a different Fax device.
© eMill 2001-2015 . All trademarks property of their owners.


Store Options

eMill by default stores message and statistics information in SQLite databases. However, eMill can also store this data in a MySQL or SQL Server external database.

  • From the Tools/Options, menu, click on the Store tab:
  • Check Store message list and tracking statistics in external database to let eMill use a MySQL or SQL Server external database. Please note that only new published projects will use this database.
  • Use the Data type list to select either MySQL or SQL Server database type.
  • The Database serverf ield must contain the network name of the MySQL or SQL Server database server. This can be a domain name, a NetBIOS name, an IP address or a SQL Server name like SERVERNAME\SQL2005.
  • Enter a User name allowed to connect to the database. You must enable the TCP/IP transport to connect to a SQL Server databnase and use a SQL Server user account.
  • Enter the user Password.
  • Check Use one database for all mailing projects if you want that all projects use the same database.
  • Check Create one database per account if you want to separate project data per account. The database user must have the right to create new databases.
© eMill 2001-2015 . All trademarks property of their owners.


DKIM Keys

eMill can sign outgoing messages using DKIM signature. Different keys can be used to sign messages regarding the sender email address or the sender domain.

  • From the Tools/Options, menu, click on the DKIM Keys tab:

Click the Add button to enter a new DKIM key, the Modify button to modifiy a selected DKIM key, or the Remove button the remove a selected DKIM key.

DKIM key dialog

This dialog let you configure a new DKIM key or modifying an existing DKIM key.

  • Enabled: speficies if the DKIM key can be used.
  • Selector: speficies the selector name associated with the DKIM key. The selector determines with the domain the DNS record name that contains the public key. This field is mandatory.
  • Domain: speficies the signing domain associated with the DKIM key. The domain determines with the selector the DNS record name that contains the public key. This field is mandatory.
  • Identity: specifies the identity email address of the signer. The identity address must belong to the signing Domain. This field is optional.
  • Private Key: specifies the RSA private key used to sign messages.
  • Generate: creates a new 1024 bits RSA private key. This should be used only with new DKIM keys.
  • Restrictions: speficies if the key should be used to sign messages from a specific sender or a specific sender domain. When eMill searches for a key to sign messages, it first searches in the address restricted keys, then in domain restricted keys and finally in no restricted keys. There should not be two keys with the same restriction.
  • DNS associated record name: informational field automatically generated that contains the name of the associated DNS record associated with the DKIM key.
  • DNS associated record data: example of data the DNS record associated with the DKIM key must contain. This data contains the public key.
  • Check DNS: performs a DNS lookup to check the validity of the DNS record associated with the DKIM key. The public key present in the DNS record is compared with the public RSA public key associated with the DKIM Private Key. A message box will display the result of the validity test.

© eMill 2001-2015 . All trademarks property of their owners.


Edit Shared Lists

eMill allows you to create preconfigured shared lists. These lists can then be used as receivers list or black list in project through the add new list wizard. Shared lists are available for all eMill Enterprise versions.

You need to be an administrator of the eMill server machine of have the Create and delete shared lists permission on at least one eMill account to manage shared lists.

  • Click on the Tools/Shared Lists menu:

Only lists the current user is allowed to modify are displayed. If the current user is an administrator, all list are displayed.

Add a shared list:

Click the Add button to add a new shared list. If eMill is located on the same machine as the eMill Server, a new list wizard similar to the project add list wizard will be displayed. Due to sharing requirements, only Access, MySQL, SQL Server and ADO Advanced choice are available.

Modify a shared list:

Select a shared list and click the Modify button to open the Modify Shared List property sheet.

  • Enabled: Specifies if the list is usable and visible to eMill users.
  • Name: The name of the shared list that uniquely identifies it.
  • ADO Connection String: This string is used by ADO to connect to the data source. The string identifies the driver to be used as well as various other settings used by the ADO driver. Click the Data Link Properties button to edit the connection string or the Change Data Source button to automatically create the string through the list wizard.
  • SQL Query that returns records: SQL query that returns the list records from the ADO connection.

  • Allow list access to all eMill account: Allows usage of this list to all eMill accounts users. Only administrators can set this option and only administrators are allowed to delete or modify lists allowed to all eMill accounts.
  • Allow list access to the following eMill accounts: Allow usage of this list to the checked accounts users. Note that only accounts on which the current user has the Create and delete share list permission are listed, or all accounts if the current user is an eMill Server administrator.

Delete a shared list:

Select a shared list and click the Remove button to delete it.

© eMill 2001-2015. All trademarks property of their owners.


Design your Mailing Project

Using eMill

eMill lets you create any mailing project, from the simplest to the most elaborate ones.

Simple projects are best handled using the full suite of editors and components included with eMill. No specialist skills are required. For the more ambitious projects, some knowledge in scripting, databases and html is preferable.

You can either acquire the set of skills required to perform all tasks, or act as a project manager, using eMill for organizing and centralizing teamwork. In the later case involving collaborative work, files contributed and generated with external applications must conform to the project structure both for naming and / or for file location.

Editing your contents:

If you use the project wizard to create your projects, eMill will automatically add 2 contents. An HTML content and an alternate Text content. The alternate text content is recommended for recipients which cannot or are prevented from reading HTML contents.

You may also add a content at any time by using the New Content wizard. To edit your contents you can either use the eMill integrated editors or you can use your preferred application (Dreamweaver, FrontPage, ...). Once the content is added, you need to configure the content properties and optional conditions.

In order to allow you to transmit to each one of your recipients, a unique and attractive content, eMill provides effective customization tools: inserting a receivers data source field, inserting scripts and activating contents based on conditions.

Editing your receivers list:

eMill can use any kind of data sources (license restriction may apply). All you have to do is to select the database you wish to use when you create a new project or when you add a receivers list.
- If you do not have a database, eMill can create one for you.

- If you have an Excel, Access or Outlook data source.

- If you have a client / server database requiring an ADO connection string such as Oracle or SQL Server.

- If you have a MySQL database.

- If you have an XML data source.
- If you have email addresses in an unstructured text or html file, eMill can import them by recognizing email addresses from the text.

Once you are connected to your data source, you can edit your records directly from the Receivers view. Furthermore, eMill includes a complete set of tools to manage your data sources effectively:
- You can verify the validity of your addresses prior to sending them.
- You can Import and Export your lists.
- You can filter your lists using record fields conditions.

Message Preview:

A preview is accessible at any time to verify how the message will look like for each receiver. The preview includes various mode including a MIME source view, a hierarchy view, a hex view and a source view. You can navigate through each receiver by using the Record toolbar. Alternative ways of previewing a message is either to send a test message (from the Tools menu) to any email address or to use the "Open With Outlook" toolbar button ( [image] ).

Editing the Global Script:

eMill implements script events that can be used to perform advanced customization on your mailing projects. Refer to the scripting guide for details.

Editing the project properties:

From the project properties, you access all project specific settings such as: General Properties, Receivers Lists Properties, Black Lists Properties, Header Properties, Mailer Properties, Mailer DSN Properties, S/MIME Properties and the Dialing transformation Properties

Processing incoming message:

Accessible from the Design Window or the Queues Window, the 'Incoming Messages' feature will let you configure actions to perform on received messages. For example, you can update a database record when a bounce is received, send auto replies to customers inquiries and much more.

© eMill 2001-2015 . All trademarks property of their owners.


Design Window

Click on the Design icon: The project is displayed inside the Design Window.

Click on the Queue icon: The Queues of all published projects are displayed inside the Queue Window.

Opening or creating a new project, the project Design Window is displayed: eMill uses an MDI (Multiple Document Interface) window which lets you open simultaneously several projects. The Design Window tree allows you to access easily to all project elements: message contents, mailing lists, black lists, global script, final message preview. You just have to click on a tree node on the left to display it inside the Design Window on the right part.

General View

The general view displays a project summary.

Contents Edition

Project contents are child elements of the Contents element. Select a content in the left tree to open the corresponding editor inside the Design Window on the right part.

To add a new project content, you can:

  • Right-click on the Contents element and select Add a content.
  • Click on the Project/Add a content menu to launch the New Content Wizard.
  • Click on the Add a content button in the toolbar.

Receivers view

Receivers lists are child elements of the Receivers Lists element. All enable receivers lists will be used during messages rendering.

  • To change your receivers data source, enable or disable it, remove or add a new one, use the receivers tab in project properties.
  • To add or remove columns from the database, use the menu Project -> Data Source -> Add/Remove a column or use the right-click on database titles.
  • To edit a record, select it and use Record Toolbar, keyboard shortcuts, right-click and menu functions.
  • To sort records, click on the column name.

Black List View

Black lists are child elements of the Black Lists element. All mailing receivers which are in one of the enable black lists will not receive any messages.

  • To change a black list, enable or disable it, remove or add a new one, use the Black list tab in project properties.
  • Editing a black list record is equal to editing a receivers list record.

Final Preview

Select the Preview element to render a message according to contents, scripts and the selected record of your project. The Message view displays the message content, the headers and the attachments the way they will be represented on most mail clients. The MIME view displays an advanced representation of the message MIME hierarchy and source.

  • Use the Record Toolbar to change the selected record and render a new message.
  • Each message MIME part can be displayed independently by clicking on the corresponding child element under the Preview element.

Global Script Editor

Select the Global Script element to display the global script editor. The global script is rendered by the application and saved in the Milset.vbs file.

Note: a contextual menu, gathering together the most used commands, is available for each tree element by using the mouse right-click.
© eMill 2001-2015 . All trademarks property of their owners.


Toolbars / Shortcuts / Menus

Standard Commands
Commands that let you manage files, perform basic operations throughout the application or set the project preferences and options. Most of them are available from the standard toolbox.
Command Menu | Icon | Shortcut | Focus | Action
File/New |  | Ctrl+N | Application running | Start new project , new content file or new script file
Project/New Content |  | Ctrl+E | Project file open | Add a new project content
File/Open |  | Ctrl+O | Application running | Open existing project or editable files
File/Close |  | Ctrl+W | Project file open | Close project
File/Save |  | Ctrl+S | Project file open | Save active document
File/Save All |  | Ctrl+Shift+S | Project open | Save project and all unsaved content files
View/Refresh |  | F5 | Application running | Refresh active view
File/Publish and Send |  |  | Project open | Generate 'pub' tree and optionally render the messages
 |  |  | Project file open | Open the active document with the associated external application
Tools/Send Test Message |  |  | From the preview | Send the previewed message
File/Exit |  | Ctrl+Q | Application running | Exit the application
File/Queue |  |  | Design window | Display the queue window
Project/Properties |  | Alt+Enter | Project open | Let you set/modify project properties
Edit/Undo |  | Ctrl+Z | Project file open | Cancel last command
Edit/Redo |  | Ctrl+Y | Project file open | Repete last command
Edit/Cut |  | Ctrl+X | Content file open | Move selection from document to clipboard
Edit/Copy |  | Ctrl+C | Content file open | Copy selection from document to clipboard
Edit/Paste |  | Ctrl+V | Content file open | Insert clipboard content inside document
Edit/Delete |  |  | Content file open | Delete selection
Edit/Select All |  | Ctrl+A | Content file open | Select all document content
Edit/Find |  | Ctrl+F | Content file open | Search document for string
Edit/Find Next |  | F3 | Content file open | Resume search for next string occurrence
Edit/Replace |  |  | Content file open | Search document for string to replace
Tools/Options |  |  | Project open | Let you set/modify mailing options
Tools/Import addresses |  |  | Project open | Let you quickly start a distribution list
Window/Cascade |  |  | Projects or project files open | Arrange multiple windows
Window/Tile |  |  | Projects or project files open | Arrange multiple windows
Window/Arrange Icons |  |  | Projects or project files open | Arrange collapsed windows
Help/Help Topics |  |  | Application running | Hyperlink to the help files index
HTML Editor Commands
Commands that let you create the HTML message content. Note: the embedded scripts are inserted through the Insert/Data Field command AFTER linking the HTML file to the project.
Menu Command | Icon | Shortcut | Focus | Action
Insert/Picture |  |  | HTML file in content view | Insert an image at insert point, embedded inside the email file
Insert/Bookmark |  |  | HTML file in content view | Create an anchor point at insert point
Insert/Hyperlink |  | Ctrl+K | Text or image selected | Display the hyperlink box
Insert/Horizontal Line |  | Right-click | HTML file in content view | Create an <HR> tag at insert point
Insert/Break Line |  | Shift+Enter | HTML file in content view | Create a <BR> tag at insert point
Insert/Data Field |  |  | HTML file in content view | Generate the script for inserting a content variable
Insert/Script |  |  | HTML file in content view | Insert server or client side scripts inside the document
Format/Style |  |  | HTML file in content view | Let you select standard HTML text styles
Format/Font |  |  | HTML file in content view | Let you choose the character font from list
 |  |  | HTML file in content view | Let you choose the character size from list
 |  |  | HTML file in content view | Let you choose the character color from list
Format/Alignment/Left |  |  | HTML file in content view | Align the selected paragraph lines to the left
Format/Alignment/Center |  |  | HTML file in content view | Center the selected paragraph lines
Format/Alignment/Right |  |  | HTML file in content view | Align the selected paragraph to the right
Format/Number List |  |  | HTML file in content view | Insert <OL> and generates <LI> per each selected paragraph
Format/Bullet List |  |  | HTML file in content view | Insert <UL> and generates <LI> per each selected paragraph
Format/Increase Indent |  |  | HTML file in content view | Generate BLOCKQUOTE tags around text selection
Format/Decrease Indent |  |  | HTML file in content view | Decrease quantity of BLOCKQUOTE tags around text selection
Format/Properties |  | Right-click | Object selected | Display the attribute box for selected pictures or <HR> lines
Format/Page Properties |  | Right-click | HTML file in content view | Let you specify default colors and document margins
Table/Insert Table |  |  | HTML file in content view | Display the table attributes box
Table/Insert Row |  | Right-click | Cell selected | Add one row above the row of selected cell
Table/Insert Column |  | Right-click | Cell selected | Add one column before the column of selected cell
Table/Insert Cell |  |  | Cell selected | Add one cell to row of selected cell
Table/Delete Rows |  |  | Cell selected | Remove the row of selected cell
Table/Delete Columns |  |  | Cell selected | Remove the column of selected cell
Table/Delete Cells |  |  | Cell selected | Delete selected cell, removes the <TD></TD> tags
Table/Merge Cells |  |  | Cells from row selected | Merge contiguous cells from a same row
Table/Split Cells |  |  | Cell selected | Split selected cell along row, generates colspan=2 in other rows
Table/Table Properties |  | Right-click | Cell selected | Display the table attributes box with settings of selection
Table/Cell Properties |  | Right-click | Cell selected | Display the cell attributes box with settings of selection
Tools/HTML Editor Options |  |  | Project open | Let you set your editor preferences
Record Editor Commands
Commands that let you edit records from the receivers view. Note: modifications are performed in the source database as well.
Menu Command | Icon | Shortcut | Focus | Action
Project/Record/Edit |  | Right click | Record highlighted in receivers view | Edit highlighted record
Project/Record/Add New |  | Right click | From the data view | Add new record to list
Edit/Delete |  | Del | Record highlighted in receivers view | Delete highlighted record from list
Project/Record/Move First |  | Ctrl+Home | Record highlighted in receivers view | Highlight first record in list
Project/Record/Move Previous |  | Ctrl+Left | Record highlighted in data view | Highlight previous record
Project/Record/Go To |  | Ctrl+G | From the data view | Highlight the numbered record from list
Project/Record/Move Next |  | Ctrl+Right | Record highlighted in receivers view | Highlight following record
Project/Record/Move Last |  | Ctrl+End | Record highlighted in receivers view | Highlight last record in list
Tools/Verify Addresses |  |  | From the data view | Apply filtering rules to email addresses in list
Script Editor Commands
Commands that let you edit the milset.vbs global script. Commands are available from the global view.
Menu Command | Icon | Shortcut | Focus | Action
Edit/Script Debugger/Open |  |  | Global view | Attach debugger: InterDev or Microsoft script developer
Edit/Script Debugger/ Break at Next Statement |  |  | Global view | Partially run the script
Edit/Toggle Breakpoint |  | F9 | Global view | Add / remove breakpoint, scripts execution stops at breakpoints
Edit/Clear All Breakpoints |  |  | Global view | Remove all breakpoints
Edit/Comment |  |  | Global view | Turn selection into comment
Edit/Uncomment |  |  | Global view | Remove the single quotes from selection
Edit/Bookmarks/ Toggle Bookmark |  | F2 | Global view | Add / remove bookmarks
Edit/Bookmarks/ Next Bookmark |  |  | Global view | Move cursor to next bookmark
Edit/Bookmarks/ Previous Bookmark |  |  | Global view | Move cursor to previous bookmarks
Edit/Bookmarks/ Clear All Bookmarks |  |  | Global view | Remove all bookmarks
Tools/Script Editor Options |  |  |  | Let you set your editor preferences
Queue Commands
Commands that let you publish, render and send your mailing project. Commands are available from the queue window.
Menu Command | Icon | Shortcut | Focus | Action
Queue/Mailing/Render/Start |  | Right click | Queue selected | Start generating the email files (MIME encoding)
Queue/Mailing/Render/Pause |  | Right click | Rendering started | Pause the rendering, can resume at interruption point.
Queue/Mailing/Render/Stop |  | Right click | Rendering started or paused | Cancel the rendering, offers to clean up the outbox folder
Queue/Mailing/Mailer/Start |  | Right click | Messages in outbox | Start transmission, moves messages from outbox to sent folder
Queue/Mailing/Mailer/Stop |  | Right click | Transmission started | Stop transmission, unsent messages remain in outbox
Queue/Mailing/Delete |  | Right click | Queue selected | Delete queue along with its folders
Queue/Mailing/Statistics |  | Right click | Queue selected | Present synopsis of mailing results
Queue/Mailing/Schedule |  | Right click | Queue selected | Schedule the mailing (mailer component)
Queue/Mailing/Properties |  | Right click | Queue selected | Display the mailing project properties box
Queue/Message/Open |  | Right click | Message(s) selected | Open the message file in the email client
Queue/Message/Edit |  | Right click | Message(s) selected | Open the message file in notepad (EML format)
Queue/Message/Delete |  | Right click | Message(s) selected | Delete message files
Queue/Message/Properties |  | Right click | Message(s) selected | Edit message file properties
Queue/Folder/Delete All |  | Right click | Message folder selected | Delete all messages inside folder
Queue/Folder/Abort All |  | Right click | Outbox folder selected | Abort outbox messages, moves them to the abort folder
Queue/Folder/Select All |  | Ctrl+A | Queue / folder selected | Select all folders or messages
Queue/Folder/Refresh |  | F5 | Mailer or queue selected | Refresh view

© eMill 2001-2015 . All trademarks property of their owners.


Editing the Message Content

eMill provides all necessary tools to produce attractive and personalized layouts. eMill allows you to control the management and the creation of your contents. You can create new empty contents and then edit them using the builtin eMill editor or you can import contents from exisiting files. eMill also handles other file formats that can be created from their native application and sent as attachments.

© eMill 2001-2015 . All trademarks property of their owners.


Create a new content

eMill lets you insert multiple contents within the same project and they can be edited directly within eMill:

- HTML Contents: They can be created using the eMill HTML editor or from an existing file. You can edit your contents using your preferred HTML editor by clicking on the ( [image]) icon. When you will return back to eMill, the content will be automatically reloaded.

- Text contents: They can be created using the eMill Text editor or from an existing file.

- Other contents: Any file format can be sent as an attachment.

Note: If you have used the New eMill Mailing Project wizard to create a new project, 2 contents have been created by default: an HTML content (HtmlBody) and an alternative text content (TextBody). If your receiver's mail client does not handle the HTML format, the alternative text content will allow him to display the message.

© eMill 2001-2015 . All trademarks property of their owners.


Creating new content

Adding a new content

When creating a new project, a new Html content and a new alternate Text content are created by default. However, you can always add new empty contents to your project or import existing content files. From the design window, click on Project/Add new content to launch the New Content Wizard:

Content name and description:

Content name has to be single. If the content is an attachment, the attached file name will be built with this name. Description field correspond to the optional MIME header, Content-Description.

Add a new empty content:

Select Empty HTML content, Empty Text content or Empty VBS content to create a new HTML, Text or VBScript content. A corresponding file will be created in the project folder.

Add a new content from a web page:

Select Content imported from a web page to create a new content by importing the content of a web page.
Click on Next and enter the address of the web page to import (i.e.: http://www.emill.net/newsletter.html).
Check the Import images and style sheets option to import them in the project folder.

Add a new content from an existing file:

Select Content from an existing file to import an existing file.
Click on Next and select the file you want to use. If your file is not in the project folder, it is highly recommended to copy it by leaving checked the Copy file into project folder box. Otherwise, if you publish your project on a remote eMill Server, the content could be impossible to find and the render could stop displaying the following error message: The system cannot find the file specified or Access denied.

Add a new linked web content:

This option allows you to configure a web page according to data from the receivers list. You are also able to render a content from an existing dynamic web application (intranet, extranet, web services,...).
For more details, see HTTP Settings.
Select Content linked to a web page. Click on Next and enter the address of the web page to link. If the access to the web page requires an authentication, enter the account username and password.

Add a personalized attachment per receiver:

This option allows you to send specific attachments for each receiver.

For instance, if you wish to send reports to your sales people, they will be different for each receiver. Just indicate in which folder the reports are located and which criteria will be used to define which report corresponds to which receiver (report name in a receivers list colum, report name corresponding to the receiver name...).

Select Personalized attachment per receiver and click on Next.
Click on Folder in order to select the folder where the attachments to send are located.
Right click in the text area where you want to insert information from the receivers list. For instance, if the attachment file name is indicated in one of the list column, right click at the end of the folder path and select the list column containing the attachament file names.

Wizard final window:

Check the Open content properties when I click finish box to open the content properties window after clicking on finish.

© eMill 2001-2015 . All trademarks property of their owners.


Add a new attachment

They are 2 ways for adding an attachment:

- Attach one file: select the Project/Add File Attachment menu command and select the file you wish to add. Once the file is added, a new content will be displayed in the project tree.

- Attach a personalized attachment for each receiver: select the Project/Add Content menu command and select the Personalized attachment per receiver option. Read the Add a new content help section for more details.

- Convert an existing content to an attachment: Open the Content properties dialog and change the Disposition from Inline to Attachment.

You can modify the order in which attachments are displayed by using the Content positioning window.

It is important to note that the same content personalization features are available for body contents and attachment contents.

© eMill 2001-2015 . All trademarks property of their owners.


Content properties

Content files have several properties determining which contents should be displayed inline (displayed inside the 'note' window of the email client), which ones should be sent as attachments, and which encoding has to be used for each files (MIME parts encoding). From the content view, click on the View/Properties menu. The Content Properties box is displayed:
  • Name: Name of the content inside the project. The name is used as a key to reference the Content in the Contents collection.
  • File name: Full path to the content file.
  • URL: When the content is a linked web page, the URL is indicated here. Note that you can insert data source fields in the URL by right clicking in the text area.
  • Disposition: Select Message body if you want the content to be displayed within the message body, select Attachment if you want the file to be sent as an attachment and select Inline if you want that content to be displayed inside the receiving email client's under the message body.
  • Encoding: Set what MIME encoding type the content file should be rendered in. A message having several content files can use different encoding techniques for each part. Select Auto to have eMill default to the optimized value. Otherwise, use Quoted Printable for text and html, and Base64 for all other formats.
  • Language: Set the language used by the script engine to format date, time, number, etc.
    If the content is a linked web page and if the web page is not available in the language indicated here, it will be displayed according to the web page default parameters.
  • Charset: Select the charset that corresponds to the language used in this specific content. The default charset is set from the Project General Properties box. If your content includes several languages, select the Unicode UTF-8 from the scroll down list.
    If the content is a linked web page and if the web page is not available in the charset indicated here, it will be displayed according to the web page default parameters.
  • Content-Type: The MIME content type. This value is automatically set by eMill.
  • Content-Description: Use it as a reminder if you have several content files in your message. The description will also be written in the MIME source in the attachment parts and may be displayed by mail clients.
  • Contains script code to be executed: Checked if there are server side scripts embedded inside the content.
  • Convert to PDF: This option lets you send attachments in Portable Document Format (PDF). eMill will only convert text or html files to PDF (upon rendering). All other formats require source files to be converted to PDF using Acrobat before importing into a project. Check Adobe's web site for more information about the PDF format.
  • Compress as ZIP: This option lets you send attachments in ZIP format to save space. When zipping Html files, embedded images will also be added to the zip.
  • Embed external images: only for html content. When this option is checked, eMill will download and include in the message external images referenced in the HTML content.
  • Auto-generate an alternate text part: Allows eMill to automatically create and add a new alternative text content generated from this content during rendering. This option is only available from HTML content.

Conditions:

This option lets you configure whether the content is enabled or not:

* Select "Enable this content" if you always want the content included in the message.
* Select "Disable this content" if you never want the content included in the message.

* Select "Test the following conditions" if you want the content included according to conditions results. It allows you to test the value of database fields. Click on the Add, Edit or Remove buttons to respectively add a condition, edit an existing condition or remove a condition.

Content and client specifics: email clients usually display some content in a 'message note' window and show a list of attachments that can be opened from the client or from an external application. However, there are no universal rules. Users can set their client not to display html for instance, in which case html content will show as an attachment with an alternate text file displayed instead. The configuration of the client may also affect how the message will appear (client scripts disabled, or missing plug-ins).

eMill provides you with the option to choose which order to encode the MIME parts: each content file is rendered to form one single MIME file with separated boundaries. In most cases, the first part of the MIME file will be displayed first in the 'message note' window, while following parts are either displayed in the order they are received, or shown as attachments.

HTTP Settings:

This tab appears when a content is created from a link to a web page. The options below allow you to send data to your web page: receivers list fields, server variables, session items or constants.

  • Encoding
    • Charset: Specify the charset used for sending data.
    • Encoding type: Configure the encoding type used for sending data. Choose the "multipart/form-data" encoding type if you want to send data in a binary format.

To add a data to send, click on Add ; to modify a data to send, select the element in the list and click on Edit ; to delete a data to send, select the element in the list and click on Remove.

  • Method
    • URL: Select this method to send data as parameters of your web page URL.
    • POST: Select this method to send data as parameters of your web page form (it simulates a click on a 'Submit' button).
  • Send a single field: Check this option to define a data to send.
    • Name: Give a name for the data to send.
    • Record field: Allows you to send data from the receivers list. Ex.: Enter 'email' in the name field, then, select 'Record field' and choose the 'Email' field in the list box. With the URL method, you will send the data in the following format: http://www.webpage.com/?email=receivers@receivers.com.
    • Session item: Allows you to send the value of a Global Script Session Object item. Ex.: Enter 'Test' in the name field, then, select 'Session item" and enter the name of the Session item. With the URL method, you will send the data in the following format: http://www.webpage.com/?Test=SessionItemValue.
    • Server variable: Allows you to send a value of the ServerVariables collection from the Request object (PROJECT_PATH, CONTENT_NAME, etc.). See Script Server Guide.
    • Constant: Allows you to send a constant value. Ex.: Enter 'Note' in the name field, then, select 'Constant' and enter 'April2006'. With the URL method, you will send the data in the following format: http://www.webpage.com/?Note=April2006.

  • Send a field set: Check this option to define a data to send.
    • Prefix: This field is not mandatory but can be useful to prefix each sent data.
    • Record fields: Allows you to send the values of all the receivers list fields. For instance, if you have a list with the columns 'Name' 'FirstName' 'Email' et 'Phone' and with the URL method, you will send the data in the following format: http://www.pageweb.com/?Name=ContactName&FirstName=ContactFirstName&Email=email@email.com&phone=ContactPhoneNumber.
    • Session items: Allows you to send the different values of the Global Script Session Object items.
    • Server variables: Allows you to send the data included in the ServerVariables collection from the Request object. See Script Server Guide.

© eMill 2001-2015 . All trademarks property of their owners.


Content positionning

Content positioning

The Positioning window displays all content files used to generate the message. All content files may not be necessarily delivered to all receivers: you can have scripts to produce conditional message content (e.g. Text or HTML message body, attachment versions, etc.).

From the design window, select the Contents node, then click on the View/Properties menu.

Select a content and click on the up and down arrows to change the position. You can also select a content and slip it with the mouse into the desired position. Contents which are not message note will be displayed in the order decided in this property box.

© eMill 2001-2015 . All trademarks property of their owners.


Content Personalization

One of the key success factor of a mailing campaign is the personalization of your messages. eMill provides all the necessary tools to create attractive and highly personalized contents.

They are three ways to personalize your contents:

  • Inserting data source fields
  • Activating contents based on your conditions (receiver language, age group, country, etc.)

  • Inserting scripts

© eMill 2001-2015 . All trademarks property of their owners.


Inserting a data source field

Inserting a Receivers data source field

Messages can be quickly personalized inserting receivers data source fields (content variables) inside the HTML or Text content. The variables are supplied by the Receivers data source you have linked your project to. The server side script that merges the variables with the content is generated automatically.
  • From the contents view, in normal mode, click inside the document at the location you want to insert a content variable.
  • Select Data Field from the Insert menu:

All fields from the receivers list are listed between []. A default value that substitutes to empty records can be specified. Note that seven additional fields are retrieved from the field binding (see List Properties):

FullName: Values for this field are parsed from the [FirstName] and [LastName] fields, when available. First letters are capitalized, others uncapitalized.
FirstName: Available if 'First Name' has been bound with a data source field (see List Properties). First letter is capitalized, others uncapitalized.
LastName: Available if 'Last Name' has been bound with a data source field (see List Properties). First letter is capitalized, others uncapitalized.
EmailAddress: Values for this field are parsed from [FirstName],[LastName] and [Email] for creating the following syntax "[FirstName] [LastName]" <[Email]>.
Email: Available if 'Email' has been bound with a data source field (see List Properties). Erroneous addresses are checked using the address filter.
Fax: Available if 'Fax' has been bound with a data source field (see List Properties).
SMS: Available if 'SMS' has been bound with a data source field (see List Properties).
  • Select a Data source field and click OK. The script is automatically generated and inserted inside the content. Note that the CSafeStr function is added in order to replace NULL record fields with an empty string.

© eMill 2001-2015 . All trademarks property of their owners.


Inserting scripts

The 'insert script' feature properly includes any client or server side script inside the content file. A client script is any script that is executed by the receiving email software (e.g. Microsoft Outlook, Netscape Messenger, Eudora, Lotus Mail, Groupwise, etc.). A server script is executed by the server in order to generate the message and uses eMill's scripting features. It is independent from the client.
  • Creating new content, check the Contains script code to be executed option.
  • From the content view, in normal view mode, click inside the document at the location you want to insert the script and select the Insert/Script... menu. The Insert script box is displayed:

Client side scripts:

Select JavaScript or VB Script according to the scripting language. Paste or type your script inside the Script window. This script will not be executed by eMill's preprocessor, but will be sent along with the content.

Server side scripts:

Check the Server side script option and paste or type your VB script inside the Script window. This will signal eMill it has to execute the script at server level.
Script insertion inside the document: The location of the script inside the content source is important if you are inserting content variables for instance. eMill will generate the server side script markers at insert point. You can insert as many scripts you want (client or server side) inside one document by repeating the procedure above. The source view mode from which you can further edit will show you all scripts inserted inside the document.
Client side scripts: It is not recommended to use client side scripts if you do not fully control servers who will receive your messages. Most systems will reject mails containing client scripts because they can potentially contain viruses or other unwanted features (popup, etc.).

© eMill 2001-2015 . All trademarks property of their owners.


eMill Editors

eMill includes a wysiwyg HTML editor and a Text editor. They are useful to rapidly create attractive contents whatever is your knowledge level. You may also use your favorite editors instead (Dreamweaver, FrontPage, ...).

© eMill 2001-2015 . All trademarks property of their owners


Using the editor for TXT

Using the editor for Text

eMill's text editor lets you write Text format messages as well as content scripts for later inclusion. The editor settings let you customize the presentation of information, and are applied to the text when displayed from the editor only. The editor's output is Text and carries no font or style information.
  • From the content view, create new content and select Text file or Script file.
  • Supply the content properties.
The file is displayed in the text editor. You can edit the message using the standard commands.

© eMill 2001-2015 . All trademarks property of their owners.


Using the editor for HTML

The HTML editor features two edition modes: normal mode restitutes elements close to how they will appear in the client, while source mode lets you directly edit the document source. Use the View/HTML source menu or CTRL+H shortcut to change one mode to the other. Please note that although handling all the tags needed to achieve appealing layouts, eMill's HTML editor is destined to produce email content. If you plan to produce sophisticated layouts from a graphical interface environment, we advise you use a professional web editor and import the file into your project.

For edition instructions, refer to the standard and the html editor commands description.

Content selection:

A project may have several HTML content files. Select the file you want to edit using the Project/Select Content menu.

Page properties:

To access your HTML document properties, select the Format/Page Properties menu:
  • Page title: (Optional) - Text inserted between <TITLE></TITLE>, displayed as the document name when viewed from a web browser.
  • Margins: (Optional) - Specifies the TOPMARGIN and LEFTMARGIN attributes of the BODY tag. Determines the space between the outer limits of the client window and the content displayed.
For more properties, select the Background tab:
  • Background picture: Choose a JPEG or GIF file you want displayed in the background. Generates and affects value to the BACKGROUND attribute of the BODY tag.
  • Default text color: Generates and affects value to the TEXT attribute of the BODY tag.
  • Background color: Specifies the background filling color of the client email window. Generates and affects value to the BGCOLOR attribute of the BODY tag.

Copy/paste an HTML content from an external application:

If you create an HTML content by using an external application, you can either import the file in your project or copy the content to paste it within the eMill HTML Editor.

If you use non-professional HTML editors such as MS Word or Publisher, it is highly recommended not to import the file but to copy the content and paste it within the eMill HTML Editor by using the Special paste feature. This allows you to 'clean' the code created by these applications which could male your email being flagged as a spam by several mail clients.

To use the Special paste feature, copy the HTML content, open the eMill HTML Editor in the Design view and go to the Edit > Special paste menu.

Check the box(es) corresponding to the elements you want to remove. For instance, if you paste a content create by MS Word, it is recommended to check the Styles box. By checking the first box All tags and attributes, you will only keep the content text.

Text edition features:

The editor offers fonts available from your system. Since the email client also relies on system fonts, it is advised for consistency purposes not to use the most exotic fonts.
  • Font: Lists the fonts available from your system. Generates and affects value to the FONT tag.
  • Style: Applies to a text selection the SRTONG (bold) and EM (italic) tags.
  • Size: Generates and affects value to the SIZE attribute of the FONT tag.
  • Effects: Applies to a text selection the U (underlined) tag. The color setting generates and affects value to the COLOR attribute of the FONT tag around a text selection.
  • Separators: 'Insert Horizontal Line' generates an HR tag at insertion point. 'Insert Break Line' generates a BR tag at insertion point. 'Carriage Return' (Enter) generates a P tag at insertion point.

Inserting images:

By default, eMill embeds images inside the email file. If you need to keep images on a server, type the http:// URL to the image (e.g. IMG SRC="http://www.mycompany.com/graphics/map.gif").
  • Picture Source: Path and filename of the image. Use the adjacent button to browse for the file or type a URL string starting with http:// for images on the server. Generates and affects the value to the SRC (source) attribute of the IMG (image) tag.
  • Alternate Text: Provides a text alternate to the image for clients not downloading graphics. Generates and affects value to the ALT attribute of the IMG tag.
  • Layout: Generates and affects values to the ALIGN and BORDER attributes of the IMG tag.
  • Spacing: Generates and affects values to the HSPACE and VSPACE attributes of the IMG tag.

Hyperlinks:

Lets you create a hyperlink from a text or image selection.
  • URL: Enter the http:// address the link points to.
  • Bookmark: Adds an optional anchor point to the address above.
  • Allow link tracking: Determines whether the click on this particular link should be recorded in the tracking statistics.
  • Name: Give a name to the link in order to differentiate it when analysing the tracking statistics.

The unsubscribe link: From the Insert menu, you can select Unsubscribe link. It allows you to add a link to your message content with the text 'Click here to unsubscribe'. When a receiver clicks on this link, it opens a new email in which the following elements are already filled out:
- To: The message is sent to your project's sender email address (see Headers Properties).
- Subject: It is composed of the word 'Unsubscribe', the receiver email address and the eMill project ID.
Note that, you can process the unsubscribe request automatically with eMill thanks to the Message Rules.

Tables:

Tables are effectively used to help control HTML layouts, allowing you to position text or images inside a grid, which dimensions can be precisely set.

Tags and attributes generated for tables:
  • TABLE: Tag that indicates where a table starts <TITLE> and ends </TITLE>.
  • TR: Tag that indicates where a table row starts <TR> and ends </TR>.
  • TD: Tag that indicates where a cell inside a row starts <TD> and ends </TD>.
There are only a few basic things you need to know if you want to create your tables from the source mode (recommended):

Text and images are inserted between <TD></TD>, that delimit a cell.

Cells are included between <TR></TR>, marking the limits of a row.

Rows are included between <TABLE></TABLE>, defining a table .

The number of <TR></TR> occurrences gives the number of rows for the table. The number of <TD></TD> occurrences between each <TR></TR> gives the number of cells, and should be identical for each row if no contiguous cells are merged. Contiguous cells within a row can be merged, in which case a COLSPAN attribute is generated after the TD tag (e.g. TD COLSPAN=2 indicates 2 cells from a row are merged). Note that eMill does not generate ROWSPAN attributes from the normal mode (merges contiguous cells from two different rows).

WIDTH and HEIGHT attributes can be added to TABLE, TR and TD tags. The value is either in pixels or percentage (of window or table dimension). It is those attributes that are used to precisely control the HTML layout.

Table attributes: When creating a new table:
  • Number of Columns: Sets the number of cells per row (TD tags).
  • Number of Rows: Sets the number of rows (TR tags, which include TD tags above).
  • Size: Applies a WIDTH and / or HEIGHT attribute to the TABLE tag (choose in pixels or in percent).
  • Border: Sets the BORDER attribute of the TABLE tag (border thickness around table).
  • Cellspacing: Sets the CELLSPACING attribute of the TABLE tag (space between cells).
  • Cellpadding: Sets the CELLPADDING attribute of the TABLE tag (space between objects inside cells and outer limits of cell).
  • Table color: Sets the BGCOLOR attribute of the TABLE tag.
  • Cell color: Presets a BGCOLOR attribute to all TD tags of the table.
Additional attributes from the Table Properties option (right-click inside the table):
  • Background: Sets a JPEG or GIF image file in the table background (BACKGROUND attribute).
  • Alignment: Generates the DIV tag and sets the ALIGN attribute before the TABLE tag.
Cell attributes: Right-click inside the cell or highlight a group of cells from the same row and select Cell Properties. Note: empty cells cannot be selected from the normal view. Cells are created with a space character (nbsp) to allow selection. Create one if it was deleted.
  • Size: Applies a WIDTH and / or HEIGHT attribute to the TD tag (choose in pixels or in percent).
  • Cell color: Sets a BGCOLOR attribute to the TD tag.
  • Background: Sets a JPEG or GIF image file in the cell background (BACKGROUND attribute).
  • Horizontal alignment: Sets the ALIGN attribute to the TD tag.
  • Vertical alignment: Sets the VALIGN attribute to the TD tag.
Colors: The editor provides a color palette. Colors are applied to text, tables, cells, and the document background. You can specify custom colors and add them to the project color palette.
From the page, table, cell or font properties, select the color you want to apply. To add a color to the palette, select Custom Colors; pick your color from the chooser and Add.

© eMill 2001-2015 . All trademarks property of their owners.


Setting the editor options

eMill provides an HTML editor and a Text/Scripts editor. According to the content type, the correct editor is selected and the editable file is displayed inside the content view.

HTML editor:

Having an html file displayed in the content view, select the Tools/Html Editor Options menu:
  • Select All Tags if you are editing a file coming from an external editor. eMill's editor generates most HTML 3.2 tags but does not create meta tags or DHTML. You can edit and display those tags in the source mode.
  • Check Show Borders... to visualize invisible borders in the editing mode.
  • Check Open in HTML source mode by default to open HTML documents in source mode.
  • Check Encode 8-bit chars as HTML entities to encode all 8-bit chars to HTML entities when a corresponding entity exists (ex.: the © character is encoded to the &copy HTML entity).

Text editor:

Having a text or script file displayed in the content view, select the Tools/Script Editor Options menu:
The script editor settings let you display code in a comprehensive way. You can apply colors to various elements of the script, indent or capitalize automatically. Uncheck all options when using the editor for writing Text message content.

© eMill 2001-2015 . All trademarks property of their owners.


Editing the Records

Editing the receivers lists

Creation and management of receivers and black lists are a key step in the design of an effective mailing project. eMill provides a full set of features to create efficient and focused lists.

Indeed, eMill will allow you to add a new list from any datasource. Then, you will be able to select tables/queries and fields that you want to use for your mailing project.

Once the list is created, you have the possibility to:

- Modify records within eMill.

- Import or export adresses.

- Verify addresses.

- Edit receivers list properties and black list properties. These tools will allow you, for example, to add filters in order to get a more precise list.

Database Vocabulary

- Fields: a "field" represents a database line.

- Records: a "record" represent a database column.

- Tables: It refers to data arranged in rows and columns. A database can include several tables.

- Queries: A request for information from a database.

- ADO connection string: It is used to create and manage a connection with a database.

©eMill 2001-2015 . All trademarks property of their owners.


Add a New List

When running the New eMill Mailing Project wizard, you will be prompted to select what kind of data source you want to use to create your receivers lists. Once the project is created, you can add a new receivers list or black list by clicking on Project/Add Receivers List or Project/Add Black List.

eMill flexibility allows you to use data from any format:

  • Use a preconfigured Shared List.
  • If you do not have a database, eMill will create a specific database file (database.mdb) inside the project tree and will automatically link the project to it. You can then edit fields and records from eMill's Receivers View or from Microsoft Access.
  • If you select Microsoft Office files (Excel, Access, Windows Address Book, Outlook Contacts,...) as the data source, eMill will not create a specific database for your project. It will automatically generate the connect string to the file you have selected and ask which fields you want to use. Select the fields from the database tables or queries available.
  • If you select XML Data Source, eMill will allow you to connect to XML format used by the ADO recordset. It mainly aims at retrieving email addresses from eCommerce Shops like osCommerce or Oxid.
  • If you select other database formats as the data source, eMill will open a data link properties box which will help you to set the connection between eMill and the data source. Once the connection is successfull, you will be able to select the fields from the database tables or queries available.
  • If you want to use a MySQL database, eMill will open a specific wizard.
  • If you want to use a SQL Server database, eMill will open a specific wizard.
  • If you have email addresses in an unstructured text or html file, eMill can import them by recognizing email addresses from the text.
  • If you want to use a list from an eMill OptIn Service account (free online service for the management of subscribers list), you are able to build a live connection between your emailing project and eMill OptIn Service.
  • If you want to use the pixi* system (management of e-commerce sites back-office), you are able to build a live connection between your emailing project and the pixi* system.

All database fields selected become available to eMill and are displayed in the Receivers View. According to the communication channel you want to use (email and/or fax and/or SMS), you need to associate the email, the fax and/or the SMS field with their database equivalent. Other fields are the content variables (name, preferences, billing amount, etc.) that can be inserted inside the content using the Insert/Data Source Field option. Note that eMill automatically generates SQL queries to acquire the data, and generates the script inside the content when inserting fields from this option.

Once the list is created, you are able to filter records, to modify field binding and to edit data whether by modifying the project properties or by clicking on View/Properties.

Databases and views: Remember that records displayed in the Receivers View only constitute a VIEW of database information built from queries. If you are allowed and if you do modify records from the Receivers View, you will be in fact modifying the database entries you have linked to. Note that some databases will not allow you to modify or delete its records from the eMill Receivers View.
Linking to other CRM applications: Several CRM solutions do not rely on a single database back end that can be accessed through ADO connect strings and SQL queries. Rather, the data source is split among numerous files of various formats. eMill implements a specific provider that can link a mailing project to ACT! for instance, allowing use of any record stored from that application. eMill will detect ACT! if installed on the same machine and provide the option to link to it through its wizard. Ohter specific providers will be added over time.

© eMill 2001-2015. All trademarks property of their owners.


eMill Shared List

eMill allows you to use preconfigured Shared Lists as receivers list or blacklist.
  • When starting a new project or when adding a new data source to an existing project, select eMill Shared List data source.

  • Location: eMill server where the shared list is located. Usually only one eMill server is available. Note that the project need to be published on the same eMill server or the shared list will not be available.
  • Name: Select a shared list to connect to. Only lists you are allowed to use are listed.

Then click <Next> to select your Tables/Queries

© eMill 2001-2015 . All trademarks property of their owners.


Creating a new database

You don't have a database

You can create a new mailing database if you do not have an existing one to link to. eMill will generate a Microsoft Access compatible database inside your project folder with preset fields. You can change those fields or add your own by editing database.mdb with the Data Source/Add or Remove Column menu option, or using Microsoft Access. Whenever modifying the database, you need to refresh the project in order to make eMill aware of changes (Project/Refresh menu option).
  • Starting a new project, check I don't have a database, create one for me from the data source selection box.
To add/edit a record from the receivers view, highlight the line and use the Project/Record menu or the records toolbox.
Preset Fields and scripts: When creating a new mailing database, the following fields are automatically created:
  • Email: Recipient's address.
  • Fax: Recipient's fax number.
  • Mobile: Recipient's mobile phone number.
  • FirstName: Recipient's first name.
  • LastName: Recipient's last name.

© eMill 2001-2015 . All trademarks property of their owners.


Importing from files

eMill lets you import email addresses from many file formats (txt, html, csv, doc, etc). This feature is useful to quickly send static content to a list of distribution not saved to a database. You do not need to open the file or to have the application installed: eMill scans and recognizes email addresses from the data stream.
  • Starting a new project or changing the current data source, check Import from unstructured text files from the data source selection box.

Importing from any file

  • Select Import email addresses from any file:
  • Type the path or click on the adjacent button to browse for your file. The path of the source file and the default target database is displayed (database.mdb)

Importing from the Clipboard

If eMill is not able to import addresses from a file, you can open the file from its native application and copy the content to the clipboard. eMill will extract the addresses from the clipboard.
  • Open the file from its application and copy the content to the clipboard.
  • Starting a new project or changing the current data source, check Import from unstructured text files from the data source selection box and select Import email addresses from the clipboard:
The total number of email addresses imported into the new project database is displayed. This database only includes the email address fields. You can import from several files by saving to a different database each time, and merge all in the database.mdb from the Receivers View or using Microsoft Access.
© eMill 2001-2015 . All trademarks property of their owners.


Linking to a data source

eMill seamlessly interacts with Microsoft Access, Excel files, Outlook Address Book, Windows Address Book, ACT! 2000, and automatically generates the connect string and SQL queries to acquire the database fields. When using another format the data link properties box is displayed to help you generate the connect string.
  • Starting a new project, check either one of the following options:

    Excel Spreadsheet (.xls)
    Access Database(.mdb)
    Windows Address Book (.wab)
    Outlook Contacts
    Text Files (.txt, .csv)
  • If requested, from the data source selection box, supply the path to your file, or click on the adjacent button to browse for it:
eMill will retrieve all the tables and queries (stored procedures) from the database, and displays them in the Tables/Queries window:
  • Select a database table/query to visualize its fields. Highlight the fields you need for your project: Click on the fields holding down the CTRL key down for multiple selections. Selecting * will generate the query that acquires all fields of the table. According to the communication channel you want to use (email and/or fax and/or SMS), you need to select a field with email adresses, fax or phone numbers.
  • If requested, make the field associations for information used inside the message headers. Clicking on the scroll down lists should present you with all fields you have acquired. According to the communication channel you want to use (email and/or fax and/or SMS), you need to associate the email, the fax and/or the SMS field with their database equivalent.
SQL Query generator: Highlighting the database tables/queries and available fields generates the SQL query to acquire the data. You can however edit and enter any SQL query and bypass eMill's generator.

© eMill 2001-2015 . All trademarks property of their owners.


Generating a connect string

Linking by using ADO

eMill links to databases using ADO (ActiveX Data Objects) connect strings: the database provider (driver) and the path have to be supplied. eMill uses the drivers installed with the operating system that include providers for most database formats. The following boxes are part of your Windows 2000 operating system and documented from the Windows help.
  • Starting a new project, check Advanced ADO (SQL Server, Oracle, etc.) from the data source selection box.
  • Enter the connect string if you know it or click on the Adjacent button to call the Windows Data Link Properties box:
  • Select the provider that supports your database and enter the path to your database from the Connection tab. You can know which provider to select from your database vendor or from Microsoft's literature. You can also try a few providers from the list and Test Connection (recommended).
Once the connection successfully established, return to eMill's data source selection box by clicking OK. The connect string is displayed inside the text box:
eMill will retrieve all the tables and queries (stored procedures) from the database, and displays them in the Tables/Queries window:
  • Select a database table/query to visualize its fields. Highlight the fields you need for your project: Click on the fields holding down the CTRL key down for multiple selections. Selecting * will generate the query that acquires all fields of the table. According to the communication channel you want to use (email and/or fax and/or SMS), you need to select a field with email adresses, fax or phone numbers..
  • If requested, make the field associations for information used inside the message headers. Clicking on the scroll down lists should present you with all fields you have acquired. According to the communication channel you want to use (email and/or fax and/or SMS), you need to associate the email, the fax and/or the SMS field with their database equivalent:

SQL Query generator: Highlighting the database tables/queries and available fields generates the SQL query to acquire the data. You can however edit and enter any SQL query and bypass eMill's generator.

© eMill 2001-2015 . All trademarks property of their owners.


XML Data Source

The XML connector mainly aims at retrieving email addresses from eCommerce Shops like osCommerce or Oxid. Indeed, using this wizard, you can only connect to XML format used by the ADO or ADO.NET recordset. If you want to read more on these formats, visit the Microsoft Library web pages dedicated to the ADO recordset or to the ADO.NET recordset.

When selecting XML Data Source, the wizard lets you enter the URL where the XML file containing the email addresses is located. The URL type can be http or https and can be secured by a password.

In order to display an example of which format can be used with the XML Data Source Wizard, click here.

Note that if you want to retrieve data from XML file with a different format, you can use the DataSource Object in the Global Script (read more by openning the XML DataSource sample, File -> Open Sample).

© eMill 2001-2015 . All trademarks property of their owners.


Linking to a MySQL data source

eMill seamlessly interacts with MySQL and automatically generates the connect string and SQL queries to acquire receivers fields.
  • When starting a new project or when adding a new data source to an existing project, select the MySQL Database data source.

  • MySQL Host : Enter the name or the IP address of your MySQL server.
  • Port : Enter the TCP/IP port, the default MySQL port is 3306.
  • User name/Password : Enter your MySQL user name and password.
  • Database: Select the database that contains your receivers list.

Then click <Next> to select your Tables/Queries

© eMill 2001-2015 . All trademarks property of their owners.


Linking to a SQL Server data source

eMill seamlessly interacts with SQL Server and automatically generates the connect string and SQL queries to acquire receivers fields.
  • When starting a new project or when adding a new data source to an existing project, select the SQL Server Database data source.

  • SQL Server host: Enter the name or the IP address of your SQL Server server or choose a server from the detected server drop down list.
  • User name: Enter your SQL Server user name. If no name is provided, eMill will default to interactive Windows authentication.
  • Password: Enter your SQL Server password if a user name has been provided.
  • Database: Select the database that contains your receivers list.
  • Remember settings: Check this option to store connection settings for further usage. If you uncheck it, previous saved settings will be deleted.

Then click <Next> to select your Tables/Queries

© eMill 2001-2015 . All trademarks property of their owners.


Linking to an eMill OptIn Service account

eMill OptIn Service is a free online service that provides all the tools to handle the management of professional mailing lists for your newsletters and your email marketing campaigns.

  • Creation of customized subscription forms
  • Automatic list updates with subscriptions and unsubscriptions
  • Support of the double opt-in process
  • Unlimited number of lists and subscribers
  • List statistics displayed for each subscribers list

Connecting to an eMill OptIn Service account

If you have an eMill OptIn Service account, you are able to use eMill to broadcast an emailing campaign using one of your eMill OptIn Service lists.

To connect to your eMill OptIn Service account, follow these steps:

  • Launch the 'Add a list' wizard
  • Choose the 'eMill OptIn Service subscribers list' option
  • Enter the 'Email address' and 'password' of your eMill OptIn Service account
  • Select the eMill OptIn Service list you want to use
  • Select the list column you want to be displayed

You have now built a live connection to your eMill OptIn Service account. Every time a subscriber is added or removed from your eMill OptIn Service list, the changes are automatically reflected within your emailing project.

Note that you cannot edit your eMill OptIn Service list from eMill. If you need to edit a record, to delete a contact or to modify the column names, you must log in online to your eMill OptIn Service account.

© eMill 2001-2015 . All trademarks property of their owners.


Linking to a pixi* system

pixi* is an efficient, scalable merchandise planning and control system for e-commerce shops. It allows you to process, steer and supervise your shop 24/7 world wide.

Thanks to a partnership with the pixi* editor, MadGeniuses, eMill offers you the possibility to directly connect your emailing solution to your pixi* system. It lets you build responsive, targeted and efficient email communication processes.

Connecting to a pixi* system

Before connecting to pixi*, you must get from MadGeniuses the 'pixi* API' module. You will receive with this module, the URL, the username and the password to enter to connect to your pixi* system.

Then, you are able to set filters to only retrieve the data you need for your campaign. To enable a filter, just check the appropriate box in the different filtering option pages.

© eMill 2001-2015 . All trademarks property of their owners.


Editing the Records

eMill provides a full set of tools to optimize the management and the quality of your receivers list:

- Modifying records directly within eMill.

- Importing addresses in a list or exporting addresses from a list.

- Verifying addresses (email and fax): syntax, DNS informations, simulate sending.

© eMill 2001-2015 . All trademarks property of their owners.


Modifying records

To edit a record, use the Project/Record menu, the record toolbox, or double click on the record line (provided you have made the setting from the general options box).
  • From the Receivers or Black List view, highlight a record to edit:
The fields are either supplied by an external database you have linked to, or by the project database if you have created one. Modifying the record from the record editor will change the data in the source database.

You can also add or delete records from the Receivers View using the Project/Record/Add New or Delete option. Note that restrictions apply according to the data source option (see footnote).

Adding / Removing columns:

The receivers view columns reflect acquired database fields. To add or remove fields, use the Project/Data Source/Add New Column or Delete Column option. Note that restrictions apply according to the data source option and your database user permissions.

Data sources that do not let you edit records:

Changing records from the Receivers View will modify the entries of the database the project is linked to. However, eMill will not let you edit the records nor add/remove columns in the following cases:

  • Read only database: Your database application user permissions do not allow modifying data.
  • Fields acquired from distinct tables: The SQL query retrieves data from more than one table.
  • Specific formats: Windows Address Book, Outlook Contacts or Act!

© eMill 2001-2015 . All trademarks property of their owners.


Importing/exporting addresses

Importing addresses

eMill lets you import and add records originating from any data source to the database the project is currently linked to. For instance, if your mailing project is linked to an Access database and you have the rights to modify records in it, you can import additional records from an Oracle database and add them to your Access database using eMill. All records will show from the Receivers View.

  • From the Receivers View, select the File/Import Addresses option. The wizard is displayed:
  • Select the type of data source you want to import records from. The wizard will ask you to select the tables that include the database fields to import. According to the delivery channel you want to use, the email, fax or SMS field is compulsory. The SQL query is generated automatically:
  • The wizard displays the fields available from the Receivers View, as well as those newly acquired. Highlight the fields from the Linked Fields list and their match from the Receivers Datasource and click on Link to build associations:
Click on Next. The number of all records imported is displayed. Imported records are merged to the Receivers data source.

Merging databases

If your project is linked to a corporate database, you may want to avoid consolidating it with imported records. You should export first the records from your corporate database to a temporary database, re-link your project to the temporary database using the data source wizard, and merge all additional records to the temporary database. The Import Addresses option can be used several times over.

Exporting addresses

From the the receivers view, click on File/Export Addresses to export all the receivers view records to a temporary database. This feature is useful when you do not want or cannot modify the database used in your project.

The receivers lists properties or the black lists properties also offer you the possibility to export list when publishing. When this option is selected, it is not necessary to have a permanent connection to the datasources during messages rendering.

© eMill 2001-2015 . All trademarks property of their owners.


Verifying addresses

eMill provides the option to check all addresses (email, fax or SMS) prior to publishing a project. You can specify options used for checking as well as corrective measures. Modifications carried out under these measures will be reflected in the source database.
  • From the Tools menu, select Verify addresses:

Checking Options:

  • Verify address syntax:
    - Email Address: the criteria are at least one character between two '.', at least one character before the '@', at least one character between '@' and the last '.' and at least one character after the last '.' (no forbidden characters anywhere). If format incorrect, the render skips the record (entry stays in database).
    - Fax or Phone Number: All numbers must meet the requirements of the following formats: dialable, canonical or international. If it is not the case, eMill offers a special module to transform your numbers into dialable formats.
  • Resolve recipient mail server MX record: Checks if the domain name is resolved as a mail server (only available for email addresses).
  • Connect to mail server and simulate sending: Checks if the mailbox is known at the receiving server (only available for email addresses).
  • Ignore empty address: The render will skip the record (entry stays in database).

Corrective measures:

  • Delete the record: If a problem is detected from the options above, the record is deleted from the record list and from the database.
  • Update field: You can use this option to enter such comments as 'check this address', sort it and fix it later from the database.
  • Prompt to edit the record: You will have the option to edit the erroneous record as it is detected.
  • Generate event: Links the error detection to an event handler in the global script.
Removing duplicates: If you can modify the database your project is linked to from the Receivers View, the 'Tools/Remove Duplicates' option may be used. All subsequent records from the list with a similar email address or phone/fax number will be deleted from the Receivers View and from the database.

© eMill 2001-2015. All trademarks property of their owners.


Opt-In Management

This wizard allows you to automate your mailing lists subscription management. It generates a form that you will copy/paste to your web site, and adds incoming rules to your project for handling subscription requests.
  • Right-click on your mailing list in the project tree, select Opt-In Management and click on 'Next' to launch the wizard.
  • Web Form: You are now going to create the web form that a new subscriber will have to fill out for subscribing to your mailing list.
    1. Select the fields: The table lists all the fields available in the mailing list. The first step is to select the fields that the new subscriber will have to fill out in the form. For each field, you can choose if it is:

      - Mandatory: The field will appear in the subscription form. If the subscriber does not provide this information, a message will tell him that this information is mandatory.
      - Optional: The field will appear in the subscription form but the subscriber does not have to provide this information.
      - Do not ask: If you do not want a field to appear in the subscription form, uncheck the appropriate box(es).

    2. Redirection URL: Once the new subscriber has submitted the form, he will be redirected to the URL indicated here.
      If you want to redirect the new subscriber to a "Welcome" page, follow these steps:
      - Create a new page on you web site called, for instance, "welcome.html".
      - Enter the text of your "welcome" page. It is recommended to inform the new subscriber that he will receive a message to confirm his subscription. Note that you can personalize this page by using the informations provided by the new subscriber. Indeed, all available parameters are added to the Redirection URL.
      - Under Redirection URL, enter the link to the "welcome" page (e.g.: http://www.mycompany.com/welcome.html).
    3. Email Address: In order to manage automatically subscriptions and unsubscriptions, eMill creates rules that update automatically your mailing list. eMill receives the information on a new subscriber within an email sent to the address indicated here.
  • Confirmation Message:

    The confirmation message is automatically sent to a new subscriber when submitting the subscription form. It is part of the double opt-in process allowing a subscriber to confirm his subscription. Indeed, a lot of dishonorable consumers subscribe people to hundreds of list without their permission. Thereby bombarding these people with hundreds of unsolicited email messages. The double opt-in process provides you the added protection of a confirmation link that must be clicked by the new subscriber.

    • eMill lets you edit the confirmation message (message subject and body) in HTML like any other message. You can edit it by inserting your own text between the <body> and </body> tags. If you want to insert rich text, images or tables you can either write directly the appropriate HTML code or use the eMill HTML Editor and copy/paste the HTML code here.

    You also have the possiblity to personalize the confirmation message using the information the new subscriber has provided when submitting the subscription form. Use the following syntax : %NameOfTheField%. For instance, if you ask for the First Name in the opt-in form, you can start your confirmation message by "Hi %FirstName%,".

    Note that the confirmation message contains a link that should not be deleted: "<a href="%SubscribeLink%">here</a>" . Indeed, it contains the information for your system to identify the subscriber and confirm the opt-in process.

  • Final Step:
    1. Web Form Code:In order to display the subscription form within your website, you must copy all the code located in the text area and paste it within your web site HTML code (it has to be between the <body> and </body> tags).
    2. Queue Settings: In order to allow eMill to receive the message with the details on new subscribers, you must associate your project with the incoming queue corresponding to the email address indicated when creating the web form. Note that incoming queues are configured in Tools/Options/Incoming Queues and allow eMill to retrieve messages from your mail server (POP3 Server or file).

© eMill 2001-2015 . All trademarks property of their owners.


Previewing the Message

Previewing the message lets you test the message content after rendering. The most important is that it will execute all your personnalization settings: database fields, scripts (content and global) and conditions for content enabling. What you preview is exactly the message that you will be sending out for each receiver.

Although previewing only renders and displays one message (EML file) at a time, you can use the record edition commands to render and preview messages sent to any recipient.

The preview also allows you to run an anti-spam analysis to evaluate the risk of your message being flagged as a spam.

Message View:

Display your message the way it will be represented on most mail clients. The upper part of the view includes the main headers as well as the attachments list. When your message has a Text and a Html body, the message view only displays the Html body. However, each content can be independently visualized in the content preview.

MIME View :

Display the MIME hierarchy of the message as well as the message source. Click on one of the hierarchy parts to get to the corresponding source part, then click on the arrow on the right of the MIME part first line.

Note: You can test the message, edit the source and save it on the disk by using the contextual menu commands in the preview node

© eMill 2001-2015 . All trademarks property of their owners.


Previewing the content

During the final message preview, a node is created in the project tree for each message content. In order to display the message contents list, click on the preview node and then on the + symbol located on the right.

For each content, a set of views are available according to its type:

  • Content: display the content if its format is compatible with eMill. Otherwise, it displays a content description.
  • Source : display the decoded html source of text/html content type.
  • Binary: display an hexadecimal representation of the content. This view is available for contents which are not text type.
  • MIME: similar to the MIME view in the final message preview, except that the content source is displayed in bold which makes easier the distinction of the content source in the complete message source.
Note: You can open the content with the associated application or save it on the disk by using the contextual menu commands in the content node.

© eMill 2001-2015 . All trademarks property of their owners.


Message properties

The message properties box lets you visualize information on the email file (EML) and its MIME parts. Message properties are accessible from the design view during a preview (select the preview node, then click on the View/Properties menu) and from the queues (select a message, then click on the View/Properties menu).

General:

  • Size: message total size.
  • Date: creation date or sending date.
  • SMTP Receiver: display the receivers addresses list, the message will be sent to each of these addresses.
  • SMTP Sender: sender email address.
  • Status: display, for each receiver, a summary of SMTP transfers.

Source:

The source view displays the message header and the full MIME source. The header includes a set of standard and custom fields. Here is a description of some fields:

  • X-Sender: custom field corresponding to the SMTP sender. Invisible to the receiver.
  • X-Receiver: custom field corresponding to the SMTP receivers. Invisible to the receiver.
  • From: information on the sender detailed in the header properties. Visible to the receiver.
  • To: receiver email address provided by the data source. Visible to the receiver.
  • Date: display the rendering date. Visible to the receiver.
  • X-Receiver-Status: give the transfer status for a particular receiver. Custom field, Invisible to the receiver.
  • X-Priority: priority level, handled by most mail clients.
  • Subject: "Subject" given in the header properties.
  • Mime-Version: encoding version.
  • Content-Type: specify the content type for each MIME part.

MIME parts:

The upper frame of the window displays the MIME Parts Hierarchy. Select a part in the upper frame of the window to display its header in the lower frame.

© eMill 2001-2015. All trademarks property of their owners.


Anti-spam analysis

Click on the 'Anti-spam analysis' button at the bottom of the preview window to launch an anti-spam analysis of the current message.

The anti-spam analysis gets your message, analyses it and shows you an analyse score. The higher the score is, the more chances you have to get your message flagged as a spam.

There are three levels of score:

  • The green means your email is not likely to be filtered or blocked.
  • The yellow means your email may be filtered or blocked.
  • The red means your email is likely to be filtered or blocked.
Note :

The anti-spam analysis is made by the powerful Apache SpamAssassin project.

You may consider the analysis result as an heuristic advice more than a reality.

Indeed, your message may be flagged as a spam in the receiver's outbox even if the anti-spam analysis result was green because:

  • The server you are using to send emails is blacklisted.
  • The server you are using to send emails is not correctly configured.
  • The settings of the receiver's mail reader or mail provider are more sensitive than the default settings of SpamAssassin.

Click here to find more information about spam mecanisms.

©2001-2015 eMill . Toutes les marques citées sont la propriété de leurs ayants droit.


Editing the Global Script

The global script is a Visual Basic Script file generated by eMill that can store instructions. Each project includes a Milset.vbs script file saved inside the project tree.

The global view lets you edit the script, using AMS events to program functions, or to further customize data access. You can edit the global script to:
  • Access records from an XML database or non-ADO compatible databases
  • Automatically process mailing feedback
  • Deliver content conditionally according to records
  • Customize email headers according to records
The global script is presented inside the editor with several viewing options. You can display parts of the Milset.vbs script using the Event View, Object View or Full Module View buttons and selecting the Object or Event from the scroll down lists. The editor features bookmarks, breakpoints and search/replace features similar to other script editors, which you can also use instead of eMill's.

© eMill 2001-2015. All trademarks property of their owners.


Using data source events

The DataSource object exposes methods that are similar to events when used inside the global script. The main purpose of this object is to allow access to non-ADO compatible databases.

When using this object, you need to check the Use global script to access data source option from the project properties box.

The recommended method to customize the code for non-ADO compatible databases is to create your project checking the I don't have a database, create one for me option in the project wizard, and edit the global script from the global view using the following events:

Object | Event | Description
DataSource | AddNew | Called when creating a new data record from eMill.
DataSource | BOF | Beginning Of File status. True if current record position before first record.
DataSource | CancelUpdate | Called when a record modification is cancelled.
DataSource | CanDelete | Record deletion status. True if record can be deleted.
DataSource | CanMovePrevious | Ordering status. True if record can be moved backwards.
DataSource | CanUpdate | Record update status. True if record can be updated.
DataSource | Close | Closes connection to the data source.
DataSource | Delete | Deletes the current record.
DataSource | EOF | End Of File status. True if current record position after last record.
DataSource | GetRowCount | Retrieves the total number of records.
DataSource | Move | Specifies the new position of the record, upwards or backwards.
DataSource | MoveFirst | Moves record to first position.
DataSource | Open | Opens connection to the data source.
DataSource | Update | Saves changes made to the record.

© eMill 2001-2015 . All trademarks property of their owners.


Using mail events

The Mail object provides 2 events, called at the beginning and end of each email rendering. This means the events are called once per each receiver.

Check the Server Side Scripting Guide to see how you can use these events.

Object | Event | Description
Mail | OnStartRender | Called when rendering starts for current receiver.
Mail | OnEndRender | Called when rendering ends for current receiver.

© eMill 2001-2015 . All trademarks property of their owners.


Using mailing events

The Mailing object provides 5 events, called at the beginning and end of the mailing process, at rendering time. Other events are called during delivery or reception of replies.

Check the Server Side Scripting Guide to see how you can use these events.

Object | Event | Description
Mailing | OnAcceptMail | Called when an email is about to be received.
Mailing | OnEndRender | Called when rendering is finished.
Mailing | OnMailStatus | Called when an email file is transferred from Outbox to Sent or Aborted.
Mailing | OnReceiveMail | Called after an incoming email has been accepted.
Mailing | OnStartRender | Called when rendering is started for a mailing project.
Mailing | OnUrlClicked | Called when a receiver has clicked on a link within a tracked mail content or when a mail content was opened.

© eMill 2001-2015 . All trademarks property of their owners.


Editing the Project Properties

The project properties centralizes all project specific settings. Server and users specific settings are configurable using the Options dialog.
Values for all project settings are stored in the MyProject.mil file in XML format.

© eMill 2001-2015 . All trademarks property of their owners.


General Properties

  • From the Project/Properties menu, click on the General tab:
  • The Description field may be used to enter a short description about the project.
  • Select a Charset: this value is also set from the mailing defaults box.
  • Select a default Language for contents. It is used by script engine to format date, time, number, etc.
  • Select a Mail Date method: this value specifies when the MIME header date & time should be set.
  • Check the Render one mail per receiver option if your data source has an email field including several addresses per record value. A distinct email file will be rendered per each address (this feature is not available for fax numbers).
  • Check the Do not render duplicates option to render only one email or one fax per receiver having the same address. Using this option is an alternative to using the Remove Duplicates tools.
  • Specify an Error ratio threshold to abort the render. Enter 0 to abort the render at the first error. If the value is 100, the render will never abort.

© eMill 2001-2015 . All trademarks property of their owners.


Receivers Lists Properties

  • From the Project/Properties menu, click on the Receivers tab:
  • Check the box located on the left of a list to enable it, uncheck the box to disable it.
  • Click on the Add button to add a new receivers list.
  • Select a list and click on the Edit button to open the receivers lists properties.
  • Select a list and click on the Duplicate button to create a new list from the selected one.
  • Select a list and click on the Rename button to edit the list name.
  • Select a list and click on the Remove button to delete the selected list. You can have a project without any list, if, for example, it aims at automating incoming messages processing.
  • Click on Move up and Move down to change the receivers list order. Enabled list will be successively processed in this order during the render.

Receivers lists properties:

  • Enabled: it specifies if the list must be used when rendering messages.
  • List name: it aims at identifying a receivers list. Each list must have a unique name.
  • Filtering: it lets you filter your records by specifying filtering criteria on your records.

- Select "Match all of the following" if you want to display the records matching all the criteria.

- Select "Match any of the following" if you want to display the records matching one of the criteria.

  • Change Data Source: calls the Receivers List wizard to quickly change your data source

  • Field Binding: eMill requires that you bind fields which are used to address your messages. These fields are then used to create the receivers email, fax or SMS address.
  • Channels*: It lets you decide which communication channel you want to use in this project. If multiple channels are enabled, the message will use the first usable channel based on the position of the channel in the list.

    Examples when email and fax are activated:

    - If the Email field is existing and the Fax field is empty, the message will be sent to the email address.

    - If the Email field is empty and the Fax field is existing, the message will be sent to the Fax number.

    - If both Email and Fax fields are existing, the message will be sent to the email address if the email channel is the first in the channels list and to the fax number if the fax channel is the first.

  • ADO Connection String: This string is used by ADO to connect to the data source. The string identifies the driver to be used as well as various other settings used by the ADO driver. Use the Data Link Properties to edit the connection string. You can also complelty reset this string by using the Receivers List Wizard.
  • SQL Query that returns records: After successfully linking to the data source, eMill displays all possible queries to access data records inside the tables. Select the queries accessing the table that include the recipient's address fields (Email, FirstName, LastName) and match the fields from the Recipients address fields.
  • Predefined queries: Use this list to quickly select a SQL Table or a SQL Query from your data source.
  • Export receivers data source when publishing: When publishing to a remote eMill server, the data source may not be accessible or available, or the local database may be too large or complex to upload to a remote server. Enabling this option, the data source will be exported to a temporary database containing only receivers needed to perform the rendering.
  • Use global script to access data source: check if you are linking to an non ADO compliant database. The DataSource properties and methods inside the global script will be used to manipulate the data. Check the Server Side Scripting Guide to learn more about scripting.

The Shared list tab is present instead of the Data source tab when the list is connected to an eMill shared list.
  • Location: eMill server where the shared list is located. Usually only one eMill server is available. Note that the project need to be published on the same eMill server or the shared list will not be available.
  • Name: Select a shared list to connect to. Only lists you are allowed to use are listed.
* The Fax and SMS channels are only available if the eMill Fax option was purchased.
© eMill 2001-2015 . All trademarks property of their owners.


Black Lists Properties

The Black list is a data source view of receivers you want excluded from the mailing. The data source can be any database you are able to acquire using eMill's data source wizard. The addresses of the Black List are matched against those of the receivers list, which usually comes from another data source connection.

  • From the Project/Properties menu, select the Black Lists tab:
  • Check the box located on the left of a list to enable it, uncheck the box to disable it.
  • Click on the Add button to add a new list.
  • Select a list and click on the Edit button to open the black lists properties.
  • Select a list and click on the Duplicate button to create a new list from the selected one.
  • Select a list and click on the Rename button to edit the list name.
  • Select a list and click on the Remove button to delete the selected list. Black lists are optional.
  • Click on Move up and Move down to change the black lists order.

Black lists properties:

  • Enabled: Specifies if the list must be used to exclude email addresses or fax numbers when rendering messages.
  • List name: it aims at identifying a black list. Each list must have a single name.
  • Filtering: it lets you filter your records by specifying search criteria on your records.

- Select "Match all of the following" if you want to display the records matching all the criteria.

- Select "Match any of the following" if you want to display the records matching one of the criteria.

  • Change Data Source: calls the Data Source Connection Wizard which will allow you to change your black list data source.

  • Field Binding: Bind the Email value with the data source field containing the email address and/or bind the Fax value with the data source field containing the Fax number. When a receiver email address or fax number is included in an enabled black list, his email address or fax number will be excluded when rendering messages.

  • ADO connection string: advanced parameter used to set the link between a database and a receivers list. Click on Properties to create the ADO connection string through the Data Link Properties box. By default, this parameter is automatically completed by the Database Connection Wizard.
  • SQL query that returns excluded receivers: After successfully linking to the data source, eMill displays all possible queries to access data records inside the tables.
  • Export the black list when publishing: When publishing to a remote eMill server, the data source may not be accessible or available, or the local database may be too large or complex to upload to a remote server. Enabling this option, the data source will be exported to a temporary database containing only necessary records.
© eMill 2001-2015 . All trademarks property of their owners.


Header Properties

Headers Properties

Anti-spam filters may compromise delivery of your messages if the following informations are incorrect or missing. The MAIL FROM address must be considered compulsory.
  • From the Project/Properties menu, click on the Header tab:
  • Enter the SMTP Sender address: the sender's email address (or see footnote).
  • Enter the From address: the sender's email address (similar to above, or see footnote).
  • Enter the Reply-To address: the email address to which replies are delivered (if different than the From field).
  • Enter your Organization or name as it will appear in the header.
  • Enter the email Subject (see below for subject personalization).
  • Select a Priority level: optional, managed by most email clients.
  • Click OK or on another option tab for more mailing settings.
Headers personalization: In order to personalize headers using information from the data source, right click in the text area, go to Insert field and select the field you want to use to personalize the header. You will notice that the fields list is composed of fields from your data source as well as special fields. For more information on these special fields, go to content personalization.
'SMTP Sender' and 'From': eMill differentiates the 'SMTP Sender' (the MAIL FROM presented to the receiving server) from the 'From' address which is displayed in the message header. This distinction could be useful to bypass restriction rules regarding emission from originating servers (e.g. not allowing certain emissions from some corporate addresses). If no such restrictions apply, it is advised to use the same address in both fields since anti-spam filters at the receiving end could prevent delivering your message.
Email address format: Use the following syntax to enter addresses:
"Name" <xyz@anything.com>
or click on the button adjacent to the text field to use the 'Email Address Formatter'.

© eMill 2001-2015 . All trademarks property of their owners.


Mailer Properties

  • From the Project/Properties menu, click on the Mailer tab:
  • Select the Save sent messages option: no, header only, yes. If No is selected, resuming of aborted render won't be available.
  • Select the Save aborted messages option: no, header only, yes. If No is selected, aborting all outbox messages will delete them. Otherwise the full message or just the header will be transferred to the 'aborted' folder. Note that messages which addresses cannot be resolved will also be transferred accordingly.
  • Select a Throttle value: determines the overall maximum quantity of messages sent per minute, regardless of the number of outgoing queues and their respective thread count settings.
  • Retries: sets the interval between connections attempts to the receiving mail server.

© eMill 2001-2015. All trademarks property of their owners.


Mailer DSN Properties

  • From the Project/Properties menu, click on the Mailer DSN tab:
This dialog box defines parameters used by the RFC1891 SMTP extension, which allows an SMTP client to specify (a) that delivery status notifications (DSNs) should be generated under certain conditions, (b) whether such notifications should return the contents of the message.
Most modern SMTP servers support the RFC1891 extension. Our testings show that about 60% of servers support this extension (July, 2002).
  • Enable the Never check box if you do not want SMTP servers to send any delivery notifications.
  • Enable the Success check box if you want to receive delivery success notifications.
  • Enable the Failure check box if you want to receive delivery failure notifications.
  • Enable the Delay check box if you want to receive delivery delay notifications.
  • Select Header Only if you do not wish the entire message to be returned (recommended).
  • Enable the Create local delivery notifications check box if you want to receive notifications when a message sending is aborted. Moreover, it allows you to receive notifications when using the built-in SMTP server to send messages.

© eMill 2001-2015 . All trademarks property of their owners.


S/MIME Properties

  • From the Project/Properties menu, click on the S/MIME tab:
  • Digitally sign messages: You can send signed messages in clear mode or in opaque mode. In clear mode, the digital signature is added at the end of the message; in opaque mode, the message is coded. If you send signed messages in opaque mode, users of email programs which do not handle the S/MIME protocol will not be able to read your signed messages.
  • Encrypt content and attachments: If you check this option, messages will be encrypted by using the specified algorithm. In order to encrypt a message, you must have the public part of the receiver certificate (public key).

© eMill 2001-2015. All trademarks property of their owners.


SMS Properties

The SMS Properties lets you decide which part of your message will constitute the SMS content. Note that a SMS content cannot exceed 160 characters on all mobile phones.

  • From the Project/Properties menu, click on the SMS tab:
  • The SMS content is the message subject: The SMS content will be the subject of the message. The subject must be defined in the Header Properties of your project.
  • The SMS content is the message text body: Note that a SMS content is always a text and cannot be a HTML. If you have multiple text in your content list, the first enabled content will be used to create the SMS content. For modifying the content positioning, see the Content Properties.
  • The SMS content is the subject and the text body: The SMS content will be constituted of both subject and text body. Then you can choose to separate these two parts by either a space or a line break (this option is not available if you use the TM4B Email to SMS Gateway - see the SMS settings).

© eMill 2001-2015. All trademarks property of their owners.


Dialing transformation

If the fax or phone numbers included in your data source are in a format which cannot be exploited directly, eMill offers you the possibility to transform automatically the dialing.

The only number formats which can be exploited are the following ones:

- Dialable Format: it represents a number only applicable from a specific place. For instance, 2125551212 is only applicable from United States.

- International Format: it represents a number applicable from any places. For instance, +12125551212.

- Canonical Format: it represents an international format which displays more clearly the country code, the area code and the fax number. For instance, +1 (212) 555-1212.

The dialing transformation rules will help you to transform your fax and phone numbers into dialable, international or canonical format.

Main steps for creating a transformation rule:

1. Number to Test: At the bottom of the box, you can indicate a fax or a phone number which will be used to check the validity of your new transformation rule.

2. Click on Add to add a new transformation rule.

3. Source Pattern: When rendering faxes or SMS, eMill is going to compare the fax and phone numbers of your data source with the different patterns. When eMill meets a similar format, it will apply the corresponding transformation rule. Therefore, the source pattern must represent exactly the form of the numbers you want to transform. Thus, you will represent each character/figure of your number to transform in the source pattern using the following methods:

- When you meet the following characters in your number to transform: + ( ), you represent it by using the same characters. If you meet any other characters you must not represent them in the source pattern.

- When you meet in your number to transform a figure you want to delete in the resulting number, represent it with a ?

- When you meet in your number to transform a figure you want to include in the resulting number, represent it with a #

- If you want to represent a sequence of figures at the end of a number, represent it with a *

4. Define the resulting number: Once eMill has met a similar format in your data source and in the source pattern list, it transforms your fax or phone number into the format defined by the resulting number. The resulting number must represent a dialable, international or canonical format.

5. Apply your new transformation rule by clicking on OK.

6. Click on Test to check if your new transformation rule is working with the Test Number.

Example

 | Example 1 | Example 2 | Example 3
Number to transform | 555 1212 | 1-212-555-1212 | 011-33468054773
Source Pattern | ####### | 1###* | 011*
Resulting Number | +1 (212) ###-#### | +1 (###) * | +*
Transformed Number | +1 (212) 555-1212 | +1 (212) 5551212 | +33468054773

Example 3: If you want to restrict the application of the transformation rule to numbers starting with the figure 011, you need to include the figure 011 in the source pattern.

Edit a transformation rule:

  • Select the transformation rule you want to Edit.
  • Click on Edit.
  • Follow the steps for creating a transformation rule described above.

Priority between the transformation rules:

When rendering messages, eMill will compare the fax and phone numbers of your data source with the different source pattern available. eMill will start its comparison with the first source pattern in the list then the second until he finds a corresponding pattern. Thus, you have the possibility to choose the priority between your transformation rules by using the Move Up and Move Down buttons on the right of the rules list.

Duplicate a transformation rule for another project:

In order to use the same dialing transformation rules for another project, you have to follow these steps:

  • Select in the rules list the one you want to copy (you can select multiple rules by holding down the Ctrl key).

  • Right click and select copy in the menu.

  • Go to the dialing transformation box of the project where you want to add these rules.

  • Right click in the rules list where you want to add the rules and select Paste in the menu.

© eMill 2001-2015. All trademarks property of their owners.


Statistics Properties

  • From the Projet/Properties menu, click on Statistics tab:
  • Check Record message statistics to let eMill record message statistics like sent count, aborted count or bounce count. When the option is checked, a Statistics node will apprear in the queues once the mailing project is published.
  • The value Receivers list fields to attach to message contains a list of comma separated fields to associate with the message in the statistics database. It will be possible to filter or sort statistics using these field values.
  • The Tracking mode option determine whether eMill should track message openings and clicks.
  • Check Anonymous tracking to dissociate openings and clicks from original message, so per message tracking details won't be available. This option is mandatory is some countries for privacy reason.

© eMill 2001-2015. All trademarks property of their owners.


Incoming message processing

When a new message is ready to be downloaded or when a message is available for processing in the Inbox folder, various action can be taken. For example, automatic reply to a customer requests, processing unsubscribe requests, processing bounces and many more.

General properties:

From the Project/Incoming messages menu, select the General tab:

Two actions can be taken when a new message arrives in the Inbox folder:

  • Calling Mailing_OnReceiveMail() script event:
    The Mailing_OnReceiveMail() event from the Global Script is called by eMill when a message arrives in the Inbox folder. Enter your own VBScript code in this event. See the Server Side Scripting Guide for details.
  • Apply the following rule(s):
    A message rule is a set of actions that will be executed if one or more conditions are verified. For example, removing the sender of the message from the receivers list if the subject contains the word 'Remove'.

Download properties:

From the Project/Incoming Messages menu, select the Download tab:

Download options let you specify which messages gets downloaded or not from the incoming queues. If a message is not accepted, it will not be downloaded into the project Inbox folder. If at least one project accepts the message, then it will be downloaded and removed from the incoming queue. It is not possible to download and leave a message on the server, the reason for this is that it is not possible to remember messages that have already been read or not.

The following options may be selected:

  • Download it:
    The message will always be downloaded into the Inbox project.
  • Call Mailing_OnAcceptMail() script event:
    The Mailing_OnAcceptMail() from the Global Script will be called. Enter your own VBScript code to perform whatever is needed. See the le Server Side Scripting Guide for details
  • Test conditions:
    The message will be downloaded if one or all conditions in the list are verified. If no condition is present, the message will be downloaded.

Incoming queues:

In order to receive messages in the Inbox folder, you must first configure the incoming queues from the options box. Then, you must subscribe your project to the appropriate incoming queue(s). Below, the list displays all the incoming queues available.

  • From the Project/Incoming messages menu, select the Incoming queues tab:

  • Check a box to subscribe a project inbox to the queue(s). You may unsubscribe an inbox from a queue by unchecking its box.

Incoming Faxes: When launching the eMill server, a Fax incoming queue is automatically created. It allows eMill to know where incoming faxes are stored (by default C:\Program Files\Active+eMill\Fax\Inbox).

Note: Messages transferred from the incoming queues to the project 'inbox' remain on the server. Deleting the messages as they are retrieved is achieved through scripting using the OnAcceptMail event from the Mailing class. Refer to the global script section.

Testing the incoming messages processing settings:

To test rules or scripts that process incoming messages, you can simulate the reception of new messages. Use the Tools/Simulate incoming messages menu option and select one or more messages (messages must be in MIME format, .eml file).

When simulating incoming messages, actions that only work with a published project will not have any effect (e.g. moving the message to a queue project folder)

Note: the Incoming queues tab will only be displayed on published projects.

© eMill 2001-2015 . All trademarks property of their owners.


Message rule

A rule is composed by a set of conditions and a set of actions that will be applied to an incoming message. From the General tab of the Incoming Messages properties, click on Add to create a new rule:

Conditions:

You can add as many conditions as needed. If no condition are entered, all actions will be executed.
Possible conditions are:

  • Find values in the message body:
    Search for one or more text values in the message body. If the message contains an html part and an alternative text part, the search will be performed in the html part only.
  • Find values in the subject:
    Search for one or more text values in the message subject.
  • Find values in a header field
    Search for one or more text values in a header field. (header fields examples are available in the Knowledge Base - Header Fields)
  • Find values in the To, Cc or From field:
    Search for one or more text values in the To, CC or From field.
  • Find values in a body field:
    Search for one or more text values in a body field. A field in a message body is represented by the following format: "field name: field value". If the field value is on multiple lines, it must be between quotes (for more details, see the Webforms Sample).
  • Check the message date:
    Check if the message sent date is included a specified interval.
  • Check the message size:
    Check if the message size is included in a specified interval.
  • Check the message priority:
    Check the message priority for a specified value. I the priority is not set, the default message priority is set to 'Normal' priority.
  • Delivery Status Notification (aka Bounces):
    Check -> if the message is a DSN or not.
    -> the DSN Type (Failure, Success, Delayed, etc.).
    -> the DSN Status Code (the reason why you receive a DSN): 4.*.* (Temporary failure or soft bounce), 5.*.* (Permanent failure or hard bounce), 5.1.* (Address Error). You are also able to fill in any other status codes. To have a full list of the status codes used by the DSN, see the Knowledge Base.

    In order to read more on how to manage DSNs / Bounces with eMill, see the Knowledge Base.
  • Received date and time schedule:
    Check to see if the message is received on specific day(s) and hour(s) of a week.
  • The record exists in a data source:
    The condition is verified if one or more records are found in a data source. Search is performed by comparing one or more values. Compared values are either a constant or a from the message header (e.g. the 'From' field).
  • The record does not exists in the data source :
    Does the opposite of the above condition.
  • The message is digitally signed or encrypted:
    Check if the message is digitally signed or encrypted (see S/MIME).
  • The message is an unsubscribe request:
    Check if the message is an unsubscribe request from a receiver sent by using your message unsubscribe link (see Using the Editor for HTML).

Actions:

A rule must have at least one action to execute if the condition as verified.
Possible actions are:

  • Redirect the message:
    Redirects the message to one or more recipients. The message body or subject is not altered in anyway. The redirected message is placed in the Outbox folder until it is sent.
  • Move the message to a folder:
    Moves the message from the Inbox folder to any sub folder.
  • Reply to the message:
    Creates a new message in reply to the received message. The newly created message is placed in the Outbox. The response can be a text or a message template (.eml file). The text can include AMS code (VBScript).
  • Add a text to the project log :
    Appends some text to the project log. This action can be used for debugging and reporting purpose.
  • Add a record to a data source:
    Adds a record to the receivers list, the black list or any other data source. Record values may be set with constants or fields that are extracted from the received message (e.g. From field, etc.)
  • Update a record in a data source:
    Modifies one or more records in the receivers list, the black list or any other data source. Records are searched the same way as the The record exists in a data source condition. Fields can be set with constants, values extracted from the received message, and for numerical values, they can be incremented or decremented.
  • Delete a record from a data source:
    Remove one or more records the the receivers list, black list or any other data source. Records are searched the same way as the The record exists in a data source condition.
  • Delete the message:
    Deletes the received message
  • Save sender certificate to receiver certificate store:
    If you want to send encrypted messages using the S/MIME protocol, you need the receiver public key. This action saves the public key included in the incoming message in your certificate store. Thus, you will be able to send encrypted messages to this receiver in your future campaigns.
  • Call a web page:
    Lets you run actions on an external web application. If the access to the web application requires an authentication, enter the account user name and password.
  • Stop processing rules:
    This prevents other rules from executing, it does not prevent other actions in the current rule to be executed.

© eMill 2001-2015. All trademarks property of their owners.


Publish your Mailing Project

Publishing will generate the transmission queues and prepare all files for rendering and sending. According to your permissions, you can delete a published project from the queues window, make changes from the design window, and re-publish the project.
  • Open your project and select the File/Publish menu:

  • Select the eMill Server to publish to: this option is available if there are several licensed eMill users on the network (eMill Enterprise version).
  • Select the account to use: eMill server accounts that include you as a user will be displayed. You inherit publishing permissions specified during the account setup (Read, Write or Create). If your rights to the selected eMill server are too limited, you may be denied some publishing options.
  • Check Render messages in order to render messages after publishing.
  • Check Delete previously rendered messages in order to delete the messages which are already in the Outbox.
  • Check Start sending messages to run the mailer. New published emails will be directly sent.
  • Open project in the queues: when this option is checked, eMill will open the queues window and select the published project at the end of the publish process.
  • Subscribing to incoming queues: In order to allow eMill to receive messages, you must associate your project with the appropriate incoming queue. Note that incoming queues are configured in Tools/Options/Incoming Queues and allow eMill to retrieve messages from your mail server (POP3 Server or file).
Local DSN : Subscribe to this incoming queue to receive notifications when you use the built-in SMTP server and when eMill aborts the sending of a message. To receive these notifications, you must also check the 'Create local delivery notification' option in the Mailer DSN properties.

© eMill 2001-2015 . All trademarks property of their owners.


Queues Window

Click on the Queues icon: The Queues of all published projects are displayed inside the Queue Window. Click on the Design icon: The project is displayed inside the Design Window.
The Queues Window presents you with a view of all published projects (queues) for each eMill Server. Inside each queue, you will find the message folders (Inbox, Outbox, Sent, Aborted). You can click on the items to display the list of folders and files. Right clicking on an item will present you with several options (Delete All, Abort All, Refresh, Select All...), also available from the 'Queue' menu. Check the queue commands available.
  • Queues: Published project appearing as a folder in the left window under the eMill server.
  • Inbox: Message folder generated inside the queue. It receives all replies to your mailing according to how you have subscribed it to the incoming queues.
  • Outbox: Message folder generated inside the queue. It receives all rendered email files (EML) ready for sending.
  • Sent: Message folder generated inside the queue. It saves all sent messages according to settings in the mailer properties.
  • Aborted: Message folder generated inside the queue. It receives messages when using the Abort All option from the outbox folder.

Connecting to another eMill Server:

By default, the local eMill Server is displayed from the Queue View, with all projects published onto it. You can also connect to other local or remote networked eMill Servers (eMill Enterprise), and display them from your Queue View.

To add a server, select the menu File/Add Server. Enter the local or remote network name of the machine where eMill Server is running and a description.

If you want to connect to remote eMill servers, you can alternatively specify a dialup or VPN connection to launch before connecting to the eMill server.

Your rights for accessing the remote eMill Server are set from that machine's user account options.

Remote connection to an eMill Server: If you want the eMill Server to be accessed remotely by eMill Windows Client, you must open the TCP port 2156 on the machine where eMill Server is running.

© eMill 2001-2015 . All trademarks property of their owners.


Rendering messages

The render will prepare the message headers, encode the message body in MIME and transfer the email files (EML) with attachments to the outbox message folder. Encoding options include 'Quoted Printable' or 'Text(8 bit)' appropriate for text based documents, 'Base64' which is appropriate for attachments. eMill will automatically set the right values according to the content type.
  • Highlight the queue (published project only) from the Queues Window.
  • Select the Start option from the Project/Start Render menu.
You can pause / restart or stop the render using the queue commands. Pausing lets you resume rendering at interruption point. You will be prompted to resume an aborted rendering only if the Save sent messages in the Mailer Properties is not set to no.

© eMill 2001-2015 . All trademarks property of their owners.


Run the Mailer

The Mailer has two conditions - Started or Stopped - that are independent from the render status (Start / Pause / Abort). The mailer is applied to messages in the 'Outbox' folder, whether that box is empty, being filled or filled. Note that messages have to be rendered (present in the 'Outbox' folder) prior to being sent.
  • From the Queues Window, select the queue (published project) you want to apply the mailer to and toggle between Start/Stop using the Project/Start Mailer and Project/Stop Mailer menus.
Starting the mailer, all rendered files inside the 'outbox' folder are sent and transferred to the 'sent' folder according to the mailer options selected. Delivery progress can be monitored in real time from the queues window.

Checklist:

Check the following prior to attempting delivering your messages:
  1. Outgoing Queues: Check that the outgoing queues used by the mailer are enabled and that the simulation is turned off.
  2. Servers: Check that the DNS server address and SMTP domain information is supplied and accurate.
  3. Headers: Check the accuracy of the header information and its consistency with information above to ensure high rate of delivery.
  4. Feedback: Subscribe your project inbox to an incoming queue.
  5. Succession of tasks: Your project has to be published prior to being rendered, and rendered prior to being mailed.
  6. Duplicate messages: Using the scheduling features, beware not to render the messages twice by rendering at the time of publishing and specifying it as a mailer task as well.

© eMill 2001-2015 . All trademarks property of their owners.


Scheduler

To access the scheduling functions, your mailing project has to be published.
  • From the queues window, select the published mailing project you want to schedule by highlighting its folder.
  • Select the Project/Schedule menu:
The Enabled checkbox is the switch that activates or disables the scheduler. From the drop down list, you can select the action you want applied and scheduled: 'render only', 'send only' (for rendered projects only) and 'render and send' (send immediately after rendering).

Run action as:

In order to create a scheduled mailing, you must enter the login and the password you usually use to open your Windows session.

Setting the scheduling parameters:

  • The drop down list displays the triggers already configured. A trigger allows you to define when the action defined above is run. Note that you can define an unlimited number of triggers.
    - To add a trigger, click on the 'Add' button.
    - To remove a trigger, select it in the drop down list and click on the 'Remove' button.
    - To edit an existing trigger, select it in the drop down list and modify the settings.
    Note: Once you have edited, removed or added a trigger, do not forget to click on the 'Apply' button to validate the modifications.
  • Start at: Enter the time when you want to run the action. This setting applies to all the options you define below.
  • Repeat action: This optional parameter allows you to repeat the action configured (render only, send only or render and send). For instance, you can repeat the rendering every 5 hours during 5 weeks. In order to enable this option, check its box, define the periodicity (every X hours or minutes) and enter the length (during X hours or minutes).
  • Select one of these options to define what type of scheduling you want to set:
    - Run action once: Lets you schedule a unique sending. Enter the sending date.
    - Run action every X day(s): Lets you schedule regular campaigns every X days. Enter the number of days between each sending.
    - Run action every X week(s): Lets you schedule regular campaigns every X weeks. Enter the number of weeks between each sending and the week days when you want to launch the campaign.

Schedule status:

Applying a scheduled task to a published mailing project, the status of the scheduler is displayed from the queue window:
Render only: To avoid having duplicate messages rendered, make sure the default Publish only option is selected when publishing your project. All email files remain in the outbox folder awaiting delivery.
Send only: Requires you to select the Publish and render mails option when publishing your project.
Render and send: To avoid having duplicate messages sent, make sure the default Publish only option is selected when publishing your project. Check all items from the check list.
Disabled: the Enabled checkbox is unchecked.
No: no scheduled tasks are defined.
Note: eMill does not have to be running for a scheduled mailing to be sent on schedule. Exiting the application will not prevent completion of scheduled tasks.

© eMill 2001-2015 . All trademarks property of their owners.


Statistics

Statistics can be accessed during or after transmission.
  • Select the project folder from the queues window and click the Project/Statistics menu:
  • SMTP data: lets you evaluate the performance of your session. Throughput is dependent on the bandwidth available from your SMTP host and at the receiving server. If you are using multiple outgoing queues, you can make adjustments to the thread counts, giving more counts to your best servers.
  • Messages: provides the status of sent and aborted messages. Messages undeliverable because of addresses that cannot be resolved will be transferred to the aborted folder, according to the settings in the project properties.
  • DNS: provides you with the performance of your DNS server at resolving addresses.

© eMill 2001-2015 . All trademarks property of their owners.


eMill Message Tracking

eMill includes a Message Tracking module that enables you to monitor responses to sent emails. This feature makes it possible to generate detailed statistics on whom opened messages and which links were clicked.

Recording of tracking data is made through an autonomous component, the eMill Message Tracking Redirector. This component need to be installed on a public web server, running either Internet Information Service on Windows, or Apache 2 with PHP support on Linux.

Links embedded in your messages are automatically modified to include the eMill Redirector url. This url is the address of the dedicated site or virtual folder where the eMill Redirector was installed. The eMill redirector logs each click performed on mail sent and automatically redirects the client browser to the destination url. Opened messages are detected thanks to an invisible image added to the end of any html content sent.

eMill Redirector logs are then periodically retrieved by the eMill server to fill the project statistics database.

In order to use the eMill Message Tracking, you must follow two main steps :

  1. Install the eMill Redirector on a public Web Server
  2. Configure the eMill Tracking Settings

Fig. 1 - eMill Tracking diagram

© eMill 2001-2015 . All trademarks property of their owners.


eMill Redirector - Setup

Message Tracking Setup

When installing eMill Enterprise, a shortcut to the folder containing the different versions of the eMill Message Tracking Redirector is added on your desktop. Each version is designed for a specific kind of web server. Redirectors version 2 are backward compatible with redirector version 1.

eMill Tracking Redirector Version 1:

The first version of the eMill Message Tracking Redirector is desgined for IIS 5 and IIS 6. It must be installed on servers running Windows 2000, Windows XP or Windows 2003. Its installation file is eMillTrkSetup.exe.

eMill Tracking Redirector Version 2 for Windows:

The second version of the eMill Message Tracking Redirector for Windows is desgined to run on IIS 7. It must be installed on server running Windows Vista, Windows 2008 or Windows 7. It is provided as an ASP.NET web application in the zip archive AspxRedirector.zip.

eMill Tracking Redirector Version 2 for Linux:

The second version of the eMill Message Tracking Redirector for Linux is desgined to Apache 2 with PHP support. It is provided in the zip archive phpredir.zip. The Apache web server must have the Rewrite module installed and activated or the redirector won't work.

© eMill 2001-2015 . All trademarks property of their owners.


eMill Redirector Version 1 Setup

Message Tracking Redirector Version 1 Setup

The eMill Message Tracking Redirector Version 1 is an autonomous module in form of an ISAPI extension that must be installed on a public Microsoft Internet Information Server (IIS) 5 or 6. When launching the setup program, it will install the ISAPI extension dll and the MMC Snap-Ins for the IIS Manager.

Installation:

  • Step 1. Before launching the installation of the eMill Message Tracking Redirector Version 1 it is necessary to create a user account dedicated to the tracking with very limited rights. It aims at securing the communication between the eMill server and the Web server where clicks and openings are collected.
  • Step 2. Run eMillTrkSetup.exe or double click on the "eMill Message Tracking Redirector Setup" shortcut on your desktop and follow on-screen instructions.
  • Step 3. Create a Virtual Directory dedicated to the tracking. By default, eMill creates a virtual directory called "trk" under your default web site. Select "Configure the eMill Message Tracking Later" to finish the installation and configure the eMill Message Tracking manually.
  • Step 4. Enter the domain name and the user account dedicated to the tracking (see Step 1). If the user account is not part of a domain, enter the computer name it belongs to under "Domain".
  • Step 5. Click on Next to begin the installation.
  • Step 6. The eMill Message Tracking Redirector is now installed. The last page gives you the settings you will have to fill out on eMill under Tools -> Options -> Tracking. For more details, see the eMill Tracking Options Help Page.

Enabling the eMill Message Tracking on a virtual directory:

  • Open the IIS Manager from the Start/Programs/Administrative Tools/Internet Services (IIS) menu.
  • Open the Web Sites node.
  • Create a Virtual Directory dedicated to the eMill Message Tracking: Right click on one of your web site and Select New/Virtual Directory. During the wizard, enter any name (e.g. 'trk'), select an empty directory dedicated to the tracking and leave the default access permissions.
  • Right-click on the dedicated virtual directory and select All Tasks/Enable eMill Message Tracking.
  • On the Collect user account page, enter the user account that the eMill Server will use to securely retrieve eMill Redirector logs.
  • Click on Next then Finish to activate the eMill Message Tracking Redirector.
  • The new site url must then be entered in the eMill Tracking Options settings.

Modifying your eMill Message Tracking Redirector settings:

  • Right-Click on the site or virtual folder where the eMill Message Tracking is enabled and select Properties
  • Click on the 'Message Tracking' tab.

Disabling the Message Tracking Redirector:

  • Right-Click on the site or virtual folder then select All Tasks/Disable eMill Message Tracking.

© eMill 2001-2015 . All trademarks property of their owners.


eMill Redirector Version 2 for Windows Setup

Message Tracking Redirector Version 2 on Windows Setup

The eMill Message Tracking Redirector Version 2 for Windows is an autonomous module in form of an ASP.NET web application that must be installed on a public Microsoft Internet Information Server (IIS) 7. In order to make the installation less intrusive, it as to be installed manually.

Installation:

  • Step 1. Extract the AspxRedirector.zip archive content to a new directory, usually in an inetpub subfolder.
  • Step 2. Add write permission for IIS user to the file emilltrk.log extracted file. To do so, right-click this file, select Properties, go to Security tab, click Edit and add Modify and Write rights to IIS_IUSRS or Users local group.
  • Step 3. Start the IIS management console (inetmgr), and Add an application that use the extracted files folder as physical path. In our example, we create a application named trk at the root of the www.mydomain.com web site. The redirection and collect url would be http://www.mydomain.com/trk in this case.
  • Step 4. Change the collect user credentials in the web Application Settings. By default, collect user login and password are both emill.
  • Step 5. You can optionally add a value named DefaultRedirectionUrl. If this value is added, all invalid requests to the redirector will be redirected to this value.
  • Step 6. The eMill Message Tracking Redirector version 2 is now installed.

© eMill 2001-2015 . All trademarks property of their owners.


eMill Redirector Version 2 for Linux Setup

Message Tracking Redirector Version 2 on Linux Setup

The eMill Message Tracking Redirector Version 2 for Linux is an autonomous module in form of a set of PHP files that must be installed on Apache 2 with PHP support. Apache 2 Rewrite module need also to be installed and activated.

Installation:

  • Step 1. Extract the files located in phpredir.zip archive into a web site directory.
  • Step 2. Add write right for apache2 user to emilltrk.log file.
  • Step 3. Ensure module Rewrite is enabled. To do so, enter the following command as root:
    a2enmod rewrite
  • Step 4. Ensure module Rewrite is allowed for the directory. This requires the option FileInfo to be overridable. For example, in the web site configuration file:
    <Directory /var/www/mysite/trk>
        AllowOverride FileInfo
    </Directory>
  • Step 5. Configure the collect user credentials in the conf.inc.php file. You need to change the $collect_username and $collect_password variable content.
  • Step 6. The eMill Message Tracking Redirector version 2 is now installed.

© eMill 2001-2015 . All trademarks property of their owners.


Message Statistics

Message statistics are available when statistics are enabled in the project properties. They are web based and accessible from the server queues by clicking on the tracking icon in the project tree.

The message tracking statistics help is directly included within the web client. Click on any question mark icon [image] to open a new help window.

Note : Microsoft Internet Information Services (IIS) version 5.0 or later must be installed on the eMill server. IIS is included with all NT based platforms (excluding XP Home). To install IIS, go to Add/Remove programs and locate IIS in the Windows components list.

© eMill 2001-2015 . All trademarks property of their owners.


eMill Fax

Fax mailing offers many advantages that complements emailing. You will have the possibility to choose which channel to use according to the data available, your needs and your target. Take advantage of eMill strength and flexibility to send and receive faxes and to combine efficiently fax mailing and emailing.

Sending Faxes

eMill offers you the possibility to send faxes in the following format: PDF (Adobe Acrobat), TIFF (picture format), HTML and TXT. To be able to send faxes using eMill, you need to:

1. Configure the Windows Fax Console. The sending of faxes is handled directly by your Windows operating system, therefore, you need to associate the Fax Console with at least one modem to send faxes.

2. Set eMill Fax Options.

3. Specify the priority between your communication channels (email, SMS and/or fax) for each receivers list in the receivers list properties box.

If the fax numbers included in your data source are in a format which cannot be exploited directly, you have the possibility to use the dialing transformation tool.

Receiving Faxes

To be able to receive faxes with eMill, you need to:

1. Create an incoming queue for your faxes in the Incoming Queue Properties box. When launching the eMill server, a fax incoming queue is automatically created. It allows eMill to know where incoming faxes are stored (by default C:\Program Files\Active+\eMill\Fax\Inbox). You can create a new incoming queue in the Incoming Queue Properties.

2. Specify the Fax Incoming Properties. Indeed, eMill offers you the possibility to receive faxes directly in the eMill inbox or to forward them to any email address. Moreover, you can choose the format in which your receive faxes in order to make incoming fax management easier.

3. Once the project is published, you must associate your project with a fax incoming queue. You can also set actions to take when receiving faxes.

How to send faxes during discount periods ? First, you have to indicate when the discount periods happen in the Windows Fax Console. Then, set the message priority as "lowest" in the Header Properties. When sending your messages, faxes will automatically be stored until the beginning of discount periods.
© eMill 2001-2015 . All trademarks property of their owners.


Server Side Scripting Samples

Knowledge Base

To take advantage of eMill power and flexibility, you can consult our knowledge base. It is updated by our engineers and thanks to your questions and comments. Therefore, do not hesitate to contact us by email if you have any suggestions.

You can also consult the FAQ section on our website to learn more about eMill.

© eMill 2001-2015 . All trademarks property of their owners.


eMill Versions and Features

Check the table below to see which functions your eMill version implements. Your software version is in the Help/About eMill option.
eMill: | Professional | Enterprise | Comments
Data source options |  |  |
Project specific database | YES | YES | Access compatible, editable through eMill
Link to desktop databases | YES | YES | Excel, Access, Address Book, Outlook, ACT!
Merge records from databases | YES | YES | Field associations, heterogeneous formats
Export records to a database | YES | YES | Access compatible, editable through eMill
Extract and import addresses | YES | YES | From unstructured text files, from the clipboard
Link to enterprise databases | Optional | YES | Oracle, Informix, SQL Server, and more...
Connect to non-ADO databases | NO | YES | DataSource scripting object
Server options |  |  |
Publish to remote servers | YES | YES | Publish onto any networked eMill server
Multiple eMill user accounts | NO | YES | Manage multiple users on an eMill server
Security and Quotas | NO | YES | Define user permissions and quotas on an eMill server
Render options |  |  |
Built-in PDF converter | Optional | YES | Convert all email contents to PDF before sending
Message tracking |  |  |
Message tracking statistics | Optional | YES | Present an overview of people who have opened or clicked on content links
eMill Redirector | NO | YES | Log and redirect http requests coming from email recipients.
S/MIME |  |  |
S/MIME available | Optional | YES (Gold and Platinium versions) | Encrypt and sign numerically your messages.
Fax |  |  |
Fax Mailing Management | Optional | YES | It gives you access to a full set of features to send and receive faxes.

© eMill 2001-2015 . All trademarks property of their owners.


Project Structure

Mailing project structure

Most files can be edited and modified using your favorite applications. Check below to see which files you can save to different names and directories than set by default.

Design tree: My Documents\eMill Projects\MyProject\

At design stage, all project files are saved by default in the eMill Projects folder under My Documents. The MyProject folder name is set by default to the mailing project name. You can rename project folders and change their location, but, all project files must stay inside their respective project folder.

  • MyProject.mil is the native eMill file which records project settings and links to all other project files.
  • Milset.vbs is the global script generated by eMill, carrying information on how to access records from the data source. May be edited from the global view or from external editors.
  • HtmlNote.htm and TextNote.txt are the html and text alternate content files created by default. You can add, delete and rename an unlimited number of content files for each mailing. These files are saved inside the project folder and imported to the project through the application (refer to Creating new content). Html and text files may be converted to PDF at rendering time. You can use external editors.
  • Database.mdb is generated when you import addresses from a file (text, html, csv...), from the clipboard, or when you create a project-specific database. Records are used for the distribution list and for creating content variables. May be edited from the receivers view or from Microsoft® Access. There is no 'Database.mdb' in the tree when you acquire records from an external database the project is linked to.
  • Other files are used to design the message: attachments, embedded pictures, etc.

File Name | Format | Comments
MyProject.mil | eMill Project | XML file that contains all project settings
Milset.vbs | Text | Global script file
DataBase.mdb | Microsoft Access database | The database that stores the distribution list if you have selected that eMill should create the database for you.
HtmlNote.htm | Html | Html content file created by default
TextNote.txt | Texte | Text alternate content file created by default
This files list should be find in the folder MyAccount@MyProject/MyProject.

Published tree: Pub\MyAccount@MyProject\MyProject\

When publishing a project, an image of all project files is made under the Pub folder (located in the eMill installation folder, usually "C:\Program Files\Active+\eMill"). "MyAccount" represents the eMill account in which you have published your project (Users for eMillPro). It is recommended that you do not rename, move or edit folders and files in the Pub folder. Modifications to a project should be made from original files in the eMill Projects folder. Publishing again overwrites the content of the Pub folder.

Message folder: Pub\MyAccount@MyProject\Messages

When publishing a project, a Messages folder is created inside the MyAccount@MyProject folder. The Messages.mdb database stores information on the email files created by the renderer (e.g.: corresponding box for each email). Rendered messages are displayed in the Outbox of the queue view, successfully sent emails are transferred to the Sent box. Note that stopping the mailer will not interrupt rendering. Rendering can be paused and resumed. Aborting the render will offer you the option to leave messages already rendered in the Outbox or to delete them. 'Aborting All' messages in the Outbox will transfer them to the Abort box, according to project properties settings (headers only, full message). Replies from recipients can be stored in the Inbox by subscribing the mailing project to an incoming queue.

© eMill 2001-2015 . All trademarks property of their owners.


Header Fields Examples

eMill uses a set of standard and custom fields to create and receive messages. Knowing these fields can be useful for settings different actions according to the headers. Here is a description of some fields:

  • X-Sender: custom field corresponding to the SMTP sender.
  • X-Receiver: custom field corresponding to the SMTP receivers.
  • From: sender email address.
  • To: receiver email address.
  • Cc: this field is used by the sender to send an email to different people.
  • Reply-To: If a receiver replies to your email directly, the answer will be sent to the "reply-to" address. If this information is not available, the answer will be sent to the "From" address. The "reply-to" address can be indicated in the header properties.
  • Organization: sender's organization if available.
  • Subject: email's subject.
  • Date: display the rendering date for outgoing messages and the reception date for incoming messages.
  • X-Priority: This field indicates the priority of the email. It goes from 1 (Lowest Priority) to 5 (Highest Priority). If this information is not available, the default priority is 3 (Normal).
  • Message-ID: The message-ID is created by eMill and is unique for each message.

For advanced users, find here more headers examples.

Custom Headers for received faxes:

  • X-eMillFax-CallerId: it represents the sender fax number. This information can be hidden by the sender.
  • X-eMillFax-Tsid: the Transmitting Station ID (TSID) represents the ID of the sender fax machine. This string is usually a combination of the fax number and the organization name. This information is not always available.
  • X-eMillFax-Csid: the calling subscriber ID (CSID) represents the ID of the receiver fax machine. It is transmitted to a fax sender, by the receiving device, when an incoming fax is detected. The CSID is often a combination of the fax number and the organization name. This information is not always available.
  • X-eMillFax-DeviceName: Name of the fax device used to receive the fax. This information is always available.
  • X-eMillFax-PageCount: Fax number of pages. This information is always available.
  • X-eMillFax-StartTime: Time when the fax reception started. This information is always available (this field is empty for Windows 2000)
  • X-eMillFax-EndTime: Time when the fax reception ended. This information is always available.
  • X-eMillFax-ExtendedStatus: This header allows you to know if faxes have been received completely or only partially. This information is only available for Windows XP and 2003. Each figure represents a status:

16 = partial reception

18 = call completed

© eMill 2001-2015 . All trademarks property of their owners.


Managing DSNs & bounces

Managing DSN or Bounces is a critical step for building efficient emailing campaigns. This article aims at giving some clues to successfully handle this problem.

Summary:

Introduction

Definitions

Scenarios

Manage DSNs in the Global Script (advanced user)

First, there are few important things to understand:

  • This article will help you to retrieve the appropriate information from a DSNs allowing you to process them efficiently. However, it is important to know that only 60% of SMTP Servers delivers Standard DSNs. This means that the clues that we will give you below are only relevant for 60% of the SMTP Server.

  • The different scenarios described below help you to configure how to process DSNs once they are in your project inbox. Therefore, we assume that you have already configured:

    1. The incoming queues: DSNs are sent to the SMTP sender address defined in the Header Properties. Therefore, you must associate your project with the incoming queues corresponding to this address.
    2. The Download conditions: Specifies which messages has to be downloaded within the project inbox.

  • Below, you will find three different scenarios:

    1. Scenario 1: When I receive a failed DSN, I want to increment by 1 a DSN field located in my data source and I want to add in a DSN comments field the reason why the delivery failed.
    2. Scenario 2: When I receive a failed DSN with a permanent failure (= hard bounce), I want to delete the record from my data source.
    3. Scenario 3: When I receive a DSN, I want to increment by 1 a DSN field located in my data source and delete the record when this counter reaches 5.

Definitions: A DSN is a message created by the recipient mail server that provides informations on the current status of the message you sent and gives you access to the following data:

DSN Type: a DSN can have 5 different types:

  • Delivered: Indicates that the message has been sussessfully delivered. For receiving this DSN type, you need to indicate that you want to receive success DSNs in the mailer DSN properties.

  • Relayed: If you have indicated in the mailer DSN properties that you want to receive DSN when the message is delivered (see above), the relayed DSN type warns you that the receiving mail server does not create DSN for successful delivery.

  • Expanded: Indicates that the message has been sussessfully delivered but forwarded directly to other email addresses. Therefore, it is possible that you receive new DSNs regarding the same message.

  • Failed: Indicates that the message delivery has failed. This can be due to many circumstances. To refine the processing of failed DSN according to these circumstances, see the Scenarios below.

  • Delayed: Indicates that the message has not been successfully delivered but that the mail server is still trying to deliver it. Therefore, it is possible that you receive new DSNs regarding the same message. The delivery can be delayed for many circumstances. To refine the processing of delayed DSN according to these circumstances, see Scenarios below.

DSN Original Recipient: The DSN Original Recipient allows you to know who was the receiver of the message.

DSN Status: The DSN Status is a code composed of three numerical fields separated by ".".

In a failed DSN, the first figure can be '4' or '5'. '5' represents a permanent failure (= hard bounce) which means that the message cannot be delivered in any way (domain does not exist, user does not exist,...). '4' represents a temporary failure (= soft bounce) which means that the message cannot be delivered for the moment (full mail box, busy SMTP Server,...). The second sub-field indicates the probable source of any delivery anomalies, and the third sub-field denotes a precise error condition, if known. In order to have a full list of the DSN Status Codes, click here.

DSN Diagnostic Code: The DSN Diagnostic code is a short sentence that defines the DSN Status.

Scenario 1: When I receive a failed DSN, I want to increment by 1 a 'DSN' field1 located in my data source and I want to add in a 'DSN comments' field the reason why the delivery failed.

  • Go to Project > Message Rules > General Tab, select 'Apply the following rule(s)', click on Add and enter a name for the rule.

  • Conditions to perform the actions:

    1. Click on Add.
    2. Select "Delivery Status Notification (DSN)" and click on Next.
    3. Select "Message is a DSN" and only check the "failed" box. Click on Finish.

  • Actions:

    1. Click on Add.
    2. Select "Update a record in the datasource". Click on Next.
    3. Select the list where the 'DSN' and 'DSN Comments' fields are located. Click on Next.
    4. A table presents you all the datasource fields available and lets you configure the actions to perform.

      -> In order to add in the 'DSN comments' field the reason why the delivery failed, select the 'DSN Comments' field, click on Edit and select 'DSN Diagnostic Code' in the list under 'New Value'. Click on OK.

      -> In order to increment the 'DSN' field by 11, select the 'DSN' field, click on Edit and select 'Increment by 1' under 'Update Value'. Click on OK.

      -> Click on Next.
    5. Now, you must tell eMill which record has to be updated. For instance, when I receive a DSN regarding the message I sent to steve@emilltest.com, I want the 'DSN' field incremented by 1 for this particular recipient. Thus, click on Add, select the field where the recipient email address is located, choose 'Equal to' in the operator list and 'DSN Original Recipient'. Note that this condition is already set by default.

Scenario 2: When I receive a failed DSN with a permanent failure (= hard bounce), I want to delete the record from my data source.

  • From the message rules 'General' tab, click on Add and enter a name for the rule.

  • Conditions to perform the actions:

    1. Click on Add.
    2. Select "Delivery Status Notification (DSN)" and click on Next.
    3. Select "Message is a DSN", check the "failed" box, check the "The status must match" box and select "5.*.* (Permanent failure)" in the list. Click on Finish.

  • Actions:

    1. Click on Add.
    2. Select "Delete a record from the datasource". Click on Next.
    3. Select your receivers list and click on Next.
    4. Now, you must tell eMill which record has to be deleted. For instance, when I receive a DSN regarding the message I sent to steve@emilltest.com, I want to delete this particular recipient. Thus, click on Add, select the field where the recipient email address is located, choose 'Equal to' in the operator list and 'DSN Original Recipient'. Note that this condition is already set by default.
Scenario 3: When I receive a DSN, I want to increment by 1 a DSN field1 located in my data source and delete the record when this counter reaches 5.

  • From the message rules 'General' tab, click on Add and enter a name for the rule.

  • Conditions to perform the actions:

    1. Click on Add.
    2. Select "Delivery Status Notification (DSN)" and click on Next.
    3. Select "Message is a DSN" and only check the "failed" box. Click on Finish.

  • Actions: You must configure 2 actions.

    Action 1: Increment by 1 a DSN field1

    1. Click on Add.
    2. Select "Update a record in the datasource". Click on Next.
    3. Select the list where the 'DSN' field is located. Click on Next.
    4. A table presents you all the datasource fields available and lets you configure the actions to perform.

      -> In order to increment the 'DSN' field by 11, select the 'DSN' field, click on Edit and select 'Increment by 1' under 'Update Value'. Click on OK.

      -> Click on Next.
    5. Now, you must tell eMill which record has to be updated. For instance, when I receive a DSN regarding the message I sent to steve@emilltest.com, I want the 'DSN' field incremented by 1 for this particular recipient. Thus, click on Add, select the field where the recipient email address is located, choose 'Equal to' in the operator list and 'DSN Original Recipient'. Note that this condition is already set by default.
    6. Click on Finish.

    Action 2: Delete the record when this counter reaches 5.

    1. Click on Add.
    2. Select "Delete a record from a datasource". Click on Next.
    3. Select your receivers list. Click on Next.
    4. Now, you must tell eMill which and when the receiver has to be deleted.
      - Indicate which record has to be deleted. For instance, when I receive a DSN regarding the message I sent to steve@emilltest.com, I want to delete this particular recipient. Thus, click on Add, select the field where the recipient email address is located, choose 'Equal to' in the operator list and 'DSN Original Recipient'. Note that this condition is already set by default.

      - Indicate that the record has to be deleted only when the counter in the 'DSN' field reaches 5. Thus, click on Add, select the 'DSN' field, choose 'is higher than or equal to' in the operator list, select 'Constant Value' and enter 5 in the text field. Click on OK.
    5. Click on Finish.
FAQ - I cannot configure an action to increment a field by 1 because the option 'Update value' is grayed: In order to increment a field, it must be configured to handle this kind of data. To create a column on your list with this kind of field, select your receivers list in the eMill project tree, go to the menu Project > List > Add new column. In the 'Data Type' list, choose 'Integer'.

Manage DSNs in the Global Script (advanced user):

eMill allows users who are familiar with script to manage DSNs through the Global Script (click on the collection name to access details and samples):

  • The Mail DSNHeaders collection allows you to access the list of DSN Headers
  • The Mail DSNReceivers collection allows you to access the list of DSN Receivers
© eMill 2001-2015 . All trademarks property of their owners.


Managing DSNs & bounces - DSN Status Codes

DSN Status Codes

The DSN Status is a code composed of three numerical fields separated by "." that gives the status of the DSN. You will find below a list of definitions for each numerical value.

First Figure:

2.X.X Success
Success specifies that the DSN is reporting a positive delivery action. Detail sub-codes may provide notification of transformations required for delivery.

4.X.X Persistent Transient Failure
A persistent transient failure is one in which the message as sent is valid, but some temporary event prevents the successful sending of the message. Sending in the future may be successful.

5.X.X Permanent Failure
A permanent failure is one which is not likely to be resolved by resending the message in the current form. Some change to the message or the destination must be made for successful delivery.

Second Figure:

X.0.X Other or Undefined Status
There is no additional subject information available.

X.1.X Addressing Status
The address status reports on the originator or destination address. It may include address syntax or validity. These errors can generally be corrected by the sender and retried.

X.2.X Mailbox Status
Mailbox status indicates that something having to do with the mailbox has cause this DSN. Mailbox issues are assumed to be under the general control of the recipient.

X.3.X Mail System Status
Mail system status indicates that something having to do with the destination system has caused this DSN. System issues are assumed to be under the general control of the destination system administrator.

X.4.X Network and Routing Status
The networking or routing codes report status about the delivery system itself. These system components include any necessary infrastructure such as directory and routing services. Network issues are assumed to be under the control of the destination or intermediate system administrator.

X.5.X Mail Delivery Protocol Status
The mail delivery protocol status codes report failures involving the message delivery protocol. These failures include the full range of problems resulting from implementation errors or an unreliable connection. Mail delivery protocol issues may be controlled by many parties including the originating system, destination system, or intermediate system administrators.

X.6.X Message Content or Media Status
The message content or media status codes report failures involving the content of the message. These codes report failures due to translation, transcoding, or otherwise unsupported message media. Message content or media issues are under the control of both the sender and the receiver, both of whom must support a common set of supported content-types.

X.7.X Security or Policy Status
The security or policy status codes report failures involving policies such as per-recipient or per-host filtering and cryptographic operations. Security and policy status issues are assumed to be under the control of either or both the sender and recipient. Both the sender and recipient must permit the exchange of messages and arrange the exchange of necessary keys and certificates for cryptographic operations.

Third Figure:

  • X.1.0 Other address status
  • X.1.1 Bad destination mailbox address
  • X.1.2 Bad destination system address
  • X.1.3 Bad destination mailbox address syntax
  • X.1.4 Destination mailbox address ambiguous
  • X.1.5 Destination mailbox address valid
  • X.1.6 Mailbox has moved
  • X.1.7 Bad sender's mailbox address syntax
  • X.1.8 Bad sender's system address
  • X.2.0 Other or undefined mailbox status
  • X.2.1 Mailbox disabled, not accepting messages
  • X.2.2 Mailbox full
  • X.2.3 Message length exceeds administrative limit.
  • X.2.4 Mailing list expansion problem
  • X.3.0 Other or undefined mail system status
  • X.3.1 Mail system full
  • X.3.2 System not accepting network messages
  • X.3.3 System not capable of selected features
  • X.3.4 Message too big for system
  • X.4.0 Other or undefined network or routing status
  • X.4.1 No answer from host
  • X.4.2 Bad connection
  • X.4.3 Routing server failure
  • X.4.4 Unable to route
  • X.4.5 Network congestion
  • X.4.6 Routing loop detected
  • X.4.7 Delivery time expired
  • X.5.0 Other or undefined protocol status
  • X.5.1 Invalid command
  • X.5.2 Syntax error
  • X.5.3 Too many recipients
  • X.5.4 Invalid command arguments
  • X.5.5 Wrong protocol version
  • X.6.0 Other or undefined media error
  • X.6.1 Media not supported
  • X.6.2 Conversion required and prohibited
  • X.6.3 Conversion required but not supported
  • X.6.4 Conversion with loss performed
  • X.6.5 Conversion failed
  • X.7.0 Other or undefined security status
  • X.7.1 Delivery not authorized, message refused
  • X.7.2 Mailing list expansion prohibited
  • X.7.3 Security conversion required but not possible
  • X.7.4 Security features not supported
  • X.7.5 Cryptographic failure
  • X.7.6 Cryptographic algorithm not supported
  • X.7.7 Message integrity failure
© eMill 2001-2015 . All trademarks property of their owners.


Managing a subscribers list with eMill

The sending of newsletters is the basis of an efficient email marketing communication for small to large companies. All eMill editions include the necessary tools to automate the management of a subscribers list: creation of a subscription form, processing of subscriptions and unsubscriptions, live list update…

This eMill tutorial aims at guiding you to set up the management of your subscribers list. Note that the tutorial first part is based on the fact that you do not have started to build a list. If you already have a subscription form on your website and if you wish to use eMill to update automatically your list, you must read the second part of this tutorial.

1. Starting the management of a subscribers list with eMill

By using the Opt-In management module, eMill provides you with all the tools to create a personalized subscription form and to deal automatically with subscription and unsubscription requests.

1.1 E-mail as the communication medium between eMill and your subscribers

During this tutorial, you will see that the e-mail is used to carry the information about a subscription or an unsubscription.

Therefore, to start, you must select one of your email addresses which will be used for this communication. Then, configure an incoming queue corresponding to this email address from the Tools > Options, Incoming queues tab (POP3 account or file). For more details on how you can configure an incoming queue, please refer to the appropriate help section.

Note that this email address does not have to be reserved for eMill and that this step is independent and can be done at the end of the tutorial.

1.2 Create a new mailing project

From the File > New menu, select ‘Empty mailing project’ and click on OK.

Enter a name and a description for the new project and click on ‘Finish’.

1.3 Create a new list

This list will be used to store the contact details you collect when someone subscribes to your newsletter. Therefore, each question of your subscription form must correspond to a column in the list.

For instance, if I ask for the e-mail address, the name, the first name and the company name in my subscription form, I must have a name, a first name, a company name and an email address column in my list.

To add a new list to your project, go to the Project > Add a receivers list menu. Enter a list name and click on ‘Next’.

Select the data source type ‘I don’t have a database, create one for me’ and click on ‘Next’ and ‘Finish’.

The list is displayed in the project tree under ‘Receivers lists’. When you select it, its content is displayed in the right window. You can see that the list already contains default columns. If you want to add or remove columns so that they match your subscription form questions, go to the Project > List > Add new column / Delete column.

1.4 Configure the automatic list update

Select the list you have just created in the project tree and click on the ‘Tools > Opt-In Management’ menu.

Click on ‘Next’ to run the wizard.

Creation of the subscription form

The first step is to create a subscription form that will be inserted on your website in order to let your visitors subscribe to your newsletter.

To create it you must:

  • Define the questions that will be displayed in the subscription form. The table lists all your list columns. For each of these, you must decide if a new subscriber must compulsorily answer the question (check the ‘mandatory’ box) or if it is optional (check the ‘optional’ box). If none boxes are checked, the question will not be added to the form. In the example below, I’m going to create a form where the new subscriber will have to give his e-mail (mandatory), his first name (optional) and his last name (mandatory).
  • The redirection URL. You must provide an address of a web page that will be displayed to the new subscriber once he submits the form. This address can be your website homepage or a page where you thank the visitor for subscribing.
  • Email Address. Enter the email address defined in 1.1. When a visitor of your website submits the subscription form, all the data he provides are sent by email to this address.

The confirmation message

Click on ‘Next’

The confirmation message is automatically sent to a new subscriber when submitting the subscription form. It is part of the double opt-in process allowing a subscriber to confirm his subscription. Indeed, a lot of dishonorable consumers subscribe people to hundreds of list without their permission. Thereby bombarding these people with hundreds of unsolicited email messages. The double opt-in process provides you the added protection of a confirmation link that must be clicked by the new subscriber.

eMill lets you edit the confirmation message (message subject and body) in HTML like any other message. You can edit it by inserting your own text between the and tags. If you want to insert rich text, images or tables you can either write directly the appropriate HTML code or use the eMill HTML Editor and copy/paste the HTML code here.

You also have the possiblity to personalize the confirmation message using the information the new subscriber has provided when submitting the subscription form. Use the following syntax: %NameOfTheField%. For instance, if you ask for the First Name in the opt-in form, you can start your confirmation message by "Hi %FirstName%,".

Note that the confirmation message contains a link that should not be deleted: "<a href="%SubscribeLink%">here</a>". Indeed, it contains the information for your system to identify the subscriber and confirm its subscription.

Insert the subscription form in your website

Click on ‘Next’

Now, you just need to insert the subscription form you have just created in your website. Start by selecting the whole HTML code included in the window.

Then, open one of your website page within an HTML editor. If you use a WYSIWIG HTML editor, switch to the ‘Code’ view. Finally, paste the form code where you want it to be displayed.

The message rules

Click on ‘Finish’

The message rules are created in order to automate the processing of subscription and unsubscription requests. When a window asks you if you want to publish your project, answer ‘Yes’ in order to validate the creation of the rules.

When the publish dialog box is displayed, uncheck all the boxes under ‘Once the project is published’, and, under ‘Subscribed incoming queues’, check the box corresponding to the incoming queue you created in 1.1.

To give you more details, here is an explanation of what the rules are doing:

  • Subscription: As we explained above, when a visitor of you website submits the subscription form, an email including all his contact details is sent to the email address defined in 1.1. The ‘Subscription’ rule tells eMill to download this email and to update your list using the information provided by the new subscriber.
  • Unsubscription: The management of a subscribers list implies that you process rigorously unsubscription requests. In each newsletter you send, you must insert a link allowing the receiver to unsubscribe from your list. To insert this link when creating a message with eMill, go to the ‘Insert > Unsubscribe link’ menu.

    When a subscriber clicks on the unsubscribe link, an email including his contact details is sent to the email address defined in 1.1. The ‘Unsubscription’ rule tells eMill to download this email and to delete the subscriber from your list.

The configuration of eMill is over. All the maintenance of your list is now automated. You just have to concentrate on creating and broadcasting your newsletter.

2. How to create the message rules

If you already have a subscription form or if you want to create it using another tool than the eMill Opt-In Management module, you can automate the maintenance of your subscribers list with eMill. Note that this system can only be used if you receive the subscription or unsubscription requests by e-mail on one of your email addresses.

The second part of the tutorial details how you can configure the message rules to process these requests. They will allow eMill to automatically download the subscription or unsubscription emails and to update your list with the information included in these emails.

First, follow the steps described in 1.1 (incoming queues), 1.2 (create a new project) and 1.3 (create a new list). Then, to start configuring the message rules, go to the Project > Message rule menu.

2.1 Specify the download conditions

If the email address used to receive the information on a new subscriber is not reserved for this particular use, you must define download conditions to avoid all the received emails being downloaded by eMill.

Click on the ‘Download’ tab, check the ‘Test the following conditions’ option and click on ‘Add’.

Speaking generally, in order to detect a subscription or an unsubscription request, we use keywords included in the email subject. For instance, an email including information on a new subscriber will have as a subject ‘Subscribe form’ and an unsubscription request will have as a subject ‘Unsubscribe’.

In the first window, select the ‘Find values in the subject’ option.

In the ‘Criteria’ field, select ‘contains any’ and enter under ‘Value(s)’ the text: Subscribe, Unsubscribe. An email will be downloaded within your eMill inbox only if its subject line contains ‘Subscribe’ or ‘Unsuscbribe’.

Click on ‘Finish’

2.2 Processing subscription requests

This step lets you configure eMill to retrieve the information provided by a new subscriber in order to update your list. Before configuring the rule, it is important to note that:

  • Your subscribers list must contain a column corresponding to each question of the subscription form.
  • The content of the received email must be structured as follow:

    Form question: Subscriber’s answer
    (i.e., Name: Jones)

    Note that the character ‘:’ can be replaced by ‘=’. If the answer is written on multiple lines, it must be between ‘«’ and ‘»’.

Click on the ‘General’ tab, check the ‘Apply the following rule(s)’ option and click on ‘Add’.

Conditions to execute a message rule

The first step to create a message rule is to define when it has to be executed. As we did above (2.1), we are going to use the text of the subject line to detect an email for a subscription request.

Click on the first ‘Add’ button

Select the ‘Find values in the subject’ option and click on ‘Next’.

In the ‘Criteria’ field, select ‘contains any’ and enter under ‘Value(s)’ the following text: Subscribe.

Click on ‘Finish’

The message rule

The second step is to define the action that will be executed when a subscription request is detected. In this tutorial, the action is to use the information on the new subscriber included in the email to update the list.

Click on the second ‘Add’ button.

Select the ‘Add a record to a data source’ option and click on ‘Next’.

Select the ‘A project receivers list’ option and the subscribers list you have created at the beginning of the tutorial.

The following window is displayed:

On the left, the subscribers’ list columns are listed; on the right, you have to indicate which value included in the email corresponds to the column.

For instance, select the ‘E-mail’ column and click on ‘Edit’.

We have seen previously that in the body of the received email, the information is presented as follow: E-mail address: Subscriber’s email address.

Therefore, the ‘E-mail’ column has to be updated with the information of the ‘E-mail address’ field included in the message body.

Select in the list the ‘Field from the message body’ option and write on the right: E-mail address.

Click on ‘OK’ and repeat the operation for each information you want to retrieve from the received email.

Click on ‘Finish’ and ‘OK’.

2.3 Processing unsubscription requests

This section lets you configure eMill to detect unsubscription requests, retrieve the information on the subscriber and remove him from the list. In this example, we assume that the unsubscription request has in its subject line « Unsubscribe SubscriberEmailAddress ». This is the format of the email you receive if you insert the eMill unsubscribe link in your newsletter.

Click on the ‘Add’ button.

Conditions to execute a message rule

The first step to create a message rule is to define when it has to be executed. As we did above (2.2), we are going to use the text of the subject line to detect an email for an unsubscription request.

Click on the first ‘Add’ button.

Select the ‘Find values in the subject’ option and click on ‘Next’.

In the ‘Criteria’ field, select ‘contains any’ and enter under ‘Value(s)’ the following text: Unsubscribe.

Click on ‘Finish’

The message rule

The second step is to define the action that will be executed when an unsubscription request is detected. In this tutorial, the action is to delete the subscriber profile from the list.

Click on the second ‘Add’ button.

Select the ‘Delete a record from a data source’ and click on ‘Next’.

Select the ‘A project receivers list’ option and the subscribers list you have created at the beginning of the tutorial.

The following window is displayed:

This step allows you to specify which subscriber profile will be deleted. We are going to define the fact that the subscriber to remove from the list is the one whose email address matches the address in the unsubscription request subject line.

Select the list column containing your subscribers email addresses (here, it is ‘Email’) and click on ‘Edit’.

In the last list, select the ‘Email address extracted from the subject’ option.

Click on ‘OK’, ‘Finish’ and ‘OK’

Subscription and unsubscription requests will now be processed automatically.

However, be sure to always subscribe your eMill project to the incoming queue created at the beginning of the tutorial by checking the appropriate box when publishing the project.

© eMill 2001-2015 . All trademarks property of their owners.


Connecting to external lists

eMill allows you to build a live connection to most databases as well as third-party applications. This allows you to really make your emailing software interacts with your existing infrastructure in order to enhance your campaign's efficiency.

You will find in this knowledge base section several articles or tutorials which will help you to connect to the following databases or applications:

  • eMill OptIn Service: Free online service to manage subscribers list.
  • Pixi* system: E-commerce application to manage your website back-office (stock, customers, products).
© eMill 2001-2015 . All trademarks property of their owners.


Connecting to an eMill OptIn Service account

eMill OptIn Service is a free online service that provides all the tools to handle the management of professional mailing lists for your newsletters and your email marketing campaigns.

  • Creation of customized subscription forms
  • Automatic list updates with subscriptions and unsubscriptions
  • Support of the double opt-in process
  • Unlimited number of lists and subscribers
  • List statistics displayed for each subscribers list

Connecting to an eMill OptIn Service account

If you have an eMill OptIn Service account, you are able to use the platform to broadcast an emailing campaign using one of your eMill OptIn Service lists.

To connect to your eMill OptIn Service account, follow these steps:

  • Launch the Add a list wizard
  • Choose the 'eMill OptIn Service subscribers list' option
  • Enter the 'Email address' and 'password' of your eMill OptIn Service account
  • Select the eMill OptIn Service list you want to use
  • Select the list column you want to be displayed

You have now built a live connection to your eMill OptIn Service account. Every time a subscriber is added or removed from your eMill OptIn Service list, the changes are automatically reflected within your emailing project.

Note that you cannot edit your eMill OptIn Service list from the platform. If you need to edit a record, to delete a contact or to modify the column names, you must log in online to your eMill OptIn Service account.

© eMill 2001-2015 . All trademarks property of their owners.


Connecting to a pixi* system

pixi* is an efficient, scalable merchandise planning and control system for e-commerce shops. It allows you to process, steer and supervise your shop 24/7 world wide.

Thanks to a partnership with the pixi* editor, MadGeniuses, eMill offers you the possibility to directly connect your emailing solution to your pixi* system. It lets you build responsive, targeted and efficient email communication processes.

Connecting to a pixi* system

Before connecting to pixi*, you must get from MadGeniuses the 'pixi* API' module. You will receive with this module, the URL, the username and the password to enter to connect to your pixi* system.

Then, you are able to set the following filters to only retrieve the data you need for your campaign. To enable a filter, just check the appropriate box:

  • Customers who have ordered today, yesterday, one week ago, one month ago or on a specific date
  • Customers who have been shipped today, yesterday, one week ago, one month ago or on a specific date
  • Customers who have ordered a specific article (enter the article number or EAN)
  • Customers who have paid or unpaid orders
  • Customers who have shipped or unshipped orders
© eMill 2001-2015 . All trademarks property of their owners.


Creating e-mails from RSS, ATOM or RDF feeds

A tutorial on this subject could seem absurd at a first view. Indeed, why sending the content of RSS feeds by e-mail whereas many RSS readers exist? Isn’t it losing all the appeal of RSS feeds

It is obvious that the use of RSS readers is the ideal solution. However, most companies which use RSS feeds to communicate still offer the possibility to receive newsletters by e-mail in order to inform all their contacts, the RSS addicts and the others.

This tutorial aims at explaining you how eMill lets you broadcast e-mails whose contents is dynamically created using the RSS feeds to which a receiver has subscribed. Note that throughout the tutorial we speak of RSS feeds but it works exactly the same with ATOM or RDF feeds.

1. Open the project sample

The creation of this kind of eMill project needs you to write advanced code. As we want to keep the tutorial accessible to everyone, a sample project has been created. It will allow you to simply copy and paste the code.

Open the sample from the File > Open Start Page menu and click on the sample called ‘RSSReader’ on the right of the start page.

2. Create a new mailing project

From the File > New menu, select ‘Empty Mailing Project’ and click on ‘OK’.

Enter a name and a description for the new project and click on ‘Finish’.

3. Create an HTML content

From the Project > Add Content menu, enter a name and a description for the new content and click on ‘Next’.

Select ‘Add a new empty content’, ‘HTML file’ and click on ‘Next’.

Click on ‘Finish’

The new content is now displayed in the project tree under ‘Contents’.

4. Add a receivers list

From the Project > Add Receivers List menu, enter a name for this new list and click on ‘Next’.

Select the data source type. For more details on the different data sources available, please refer to the appropriate help section.

Click on ‘Next’ and ‘Finish’

Note: The receivers list must include a column called ‘Feeds’ including the address of the RSS feed at which each receiver is subscribed. To add a column in the list, go to the Project > List > Add New Column.

If a receiver is subscribed to several RSS feeds, enter the addresses in the same column separated by a comma.

5. Create the content of the message

In order to create dynamically the content of the message using the RSS feed addresses indicated in the ‘Feeds’ column of the list, you have to enter advanced code called ‘VB Script’. Thanks to the ‘RSSReader’ sample project, this step is accessible to everyone.

Open the ‘RSSReader’ project and click on the ‘HTMLBody’ content in the project tree.

Switch to the ‘HTML’ view by clicking on the ‘HTML’ button at the bottom of the editor.

Select the whole code and go to the Edit > Copy menu.

Go back to your project, click on the content you have just created, switch to the ‘HTML’ view (the button is at the bottom of the editor) and go to the Edit > Paste menu.

Advanced users are able to browse the code and modify it to adapt it to specific uses.

The creation of this project is now over. In order to check if everything is correct, click on ‘Preview’ in the project tree. In this mode, you are able to display for each receiver the content dynamically created using the RSS feed to which they are subscribed.

6. Appendix

Appendix 1: Modify the design of the message

To change the way the content of the message is displayed, you must edit the CSS code located between the <style> (line 461) and </style> (line 505) tags.

To have access to this code, click on the content in the project tree and switch to the ‘HTML’ view (the button is at the bottom of the editor).

Here are the details for each CSS elements:

  • body, table : Define the font type, the font size and the font colour used by default in the message.
  • table.header, table.footer, table.body : Define the type, the width and the color of the border around the RSS feed title and articles.
  • table.header : Define the font color of the RSS feed title.
  • td.headertext, td.footertext : Define the position of the RSS feed title and of the footer if it exists.
  • td.footertext : Centre the footer text if it exists.
  • img : Define the absence of borders around the email images.
  • hr : Define the style of the line between each RSS feed article.
  • a : Define the link style.
  • a :hover : Define the link style when the mouse is over it.
© eMill 2001-2015 . All trademarks property of their owners.


Server Side Scripting Guide

eMill provides a server-side scripting environment to create interactive email content. This environment associates the Windows Scripting Host (VBScript engine) with a server-side scripting language specialized for email: the Active Messaging Script (or AMS).

AMS implements built-in classes that users will find very similar to those of a popular scripting language used in the web context: Microsoft® Active Server Pages (or ASP).

AMS is the language used for eMill's 'global script' file (milset.vbs) that accesses the data and performs function calls triggered by render or mailer events. AMS-enabled HTML files used to personalize content can also include client-side scripts as well as calls to COM components that perform a variety of tasks, such as connecting to a database or processing business logic. AMS can also be included into TXT files if the output content is just text.

Please check the updates from our website from time to time to benefit from the latest additions and improvements to this innovative scripting language and feel free to add your two cents. This language grows on feedback.

© eMill 2001-2015 . All trademarks property of their owners.


Introduction

Active Messaging Script (AMS) makes it easy to build powerful custom messaging applications that leverage on existing database information. Since it shares a lot with existing popular scripting languages, beginners will experience a similar learning curve. Developers familiar with ASP and Visual Basic scripting will instantly feel at home.

For the MIS / IT Professional:

Personalized email is an adequate media for a growing number of business applications. Deployability, costs and versatility are key factors when reviewing customized email solutions.

By connecting to corporate databases, eMill offers both faster deployment and return on investment, while suppressing duplicating efforts. The associated Active Messaging Script language, very similar to other mainstay scripting languages, allows to programmatically adjust personalized mailings to evolving needs, quickly, incrementally, and cost-effectively. Personalized email communication can now be easily planned, created, delivered, assessed and fine-tuned using a productivity application with its optimized scripting language.

Resources from various departments can effectively participate to a Mailing Project without acquiring new skills or tools. eMill allows popular external applications to be used, and files can be contributed to a project until it is finally approved and published.

Unlike any outsourced messaging solution, eMill lets you to retain full control over sensitive data, adapting to your organization and information systems rather than the opposite. Whatever the scale of your mailings, no additional software or hardware is required other than a standard Win2K box running eMill and its built-in AMS scripting objects.

For the Marketers and Customer Relations Professionals:

Marketers know that timely use of relevant information is the prerequisite for planning effective targeted promotional campaigns. Maintaining relations with customers is recognized as a high-yield sales strategy, also fulfilling quality customer service requirements. Both extensively capitalize on corporate data in order to individualize communication.

With AMS, eMill turns any piece of stored information into a communication asset. Shortened cycles let you 'do things and try them', quickly, in a productive manner.

The way you work: Mailing projects can be entirely handled with eMill through its full suite of built-in editors and script-generating wizards, OR, eMill components can be used by a team, with copywriters, marketers, designers and scripters working with their familiar applications.

For the Web Developer, Database Expert and Scripter:

If you develop web applications using ASP server scripts and your site uses a back-end database, eMill can help you set up a highly customized email service associated to your website in a matter of hours.

You can use eMill to push customized web content, including whole websites (URL-linked documents).

You can use eMill to generate receipts, bills, account statements and any content based on user-profile.

Connecting eMill to an inter/intra/extranet website back-end database is only a few clicks away. AMS scripting is strikingly similar to ASP scripting, with all VBscript functions available.

Server-side and client-side scripts can be written from your familiar development environment and later included to content files supplied by the marketing department. You can debug AMS scripts using Visual InterDev or Microsoft Script Debugger.

Using the Preview, you can instantly test your server-side scripts as they are written, and you can simulate the whole mailing prior to delivery.

What you can learn here and elsewhere:

  • Active Messaging Script: See what AMS is all about in 10 easy steps.
  • Creating a script-enabled file: What file types can include AMS scripts and how to insert them.
  • Working with the language: Exposes the very basics of the AMS language.
  • Using variables and constants: Introduction AMS script variables and constant definitions.
  • Working with collections: How to access items in a collection.
  • Writing procedures: How to write procedures in AMS.
  • Interacting with other scripts: AMS server-side scripts that create and interact with JavaScript or VBScript client-side scripts.
  • Sending content to the client: How content is sent to an email client.
  • Accessing a data source: How eMill uses Microsoft ActiveX Data Objects (ADO) to retrieve information from a database. Alternative ways to access database records without ADO.
  • Debugging AMS: How to use debuggers with your scripts.
  • Scripting objects reference cards: Full description of AMS objects.
Learning AMS from other languages: Most topics above derive from similar topics about ASP scripting, available from the MSDN Library: Platform SDK Documentation/Web Services/Internet Information Services/Active Server Pages Guide. You can use MSDN as a reference as well, just remember that AMS does not operate in a web context and does not require IIS. Other differences between AMS and ASP will be outlined.

© eMill 2001-2015 . All trademarks property of their owners.


Active Messaging Script

Active Messaging Script (AMS) is a flexible and simple server-side scripting language working with the ubiquitous Windows Scripting Host (WSH). WSH is included with any Windows 2000 standard configuration (workstation or server).

How AMS, eMill and the data source all interact together:

AMS was specially developed for easily and reliably producing dynamically rendered email on the most basic Win2K/NT configurations (e.g. no IIS server required). eMill uses AMS to combine script-enabled HTML or TXT message content with external data source records supplied by any database it connects to, and lets you quickly and cost-effectively produce highly personalized email communication. Before taking a closer look at AMS, you can go with us through the following example. It should give you an insight into how AMS interacts with the eMill application, the database and the system resources.

Writing a basic promotional message with customized content:

This example illustrates how content is associated to a database using an ADO connect string and SQL queries. First steps are to create a database with your database application and write message content using eMill's editor. We will then insert AMS scripts inside the content to include database records, and finally, we will edit the global script to deliver content in various formats according to user preferences.

Step 1 - Data source: Using your regular database application, create a new file with a 'contact' table that includes the Email, Gender, Name, Format and Amount fields. For practical purposes, we've created a 'specials.mdb' file using Access and saved it to 'My Documents'.
Enter the following records:

eMill is well adapted for connecting to existing databases. However, if you wish to have a project-specific database, the application will create a default 'database.mdb' file through the project wizard. In that case, it is recommended although not compulsory to have Microsoft Access installed on your machine. You can also opt to use another application to create your project-specific database, and link to it through the project wizard afterwards. All subsequent changes made to records from the receivers view are made to the database.
Step 2 - Mailing project: Start eMill and create a new project. We'll name our project 'Specials'.
Creating a 'Specials' project, eMill generates a 'Specials' folder inside the ..\eMill\Projects\ directory. A 'Milset.vbs' and 'Specials.mil' files are created inside that folder.
  • Milset.vbs is the global script file generated by the eMill application that controls, among other things, the data records acquisition. This file is accessed through the global view. We will provide later an example showing how to customize the global script.
  • Specials.mil stores the project settings and properties. It can be edited with Notepad.
Step 3 - Link the project to the database: When prompted by the wizard, select the database file source option, and browse for your database location (see Add a new list for more details). Ours is 'specials.mdb' in 'My Documents'.
The application automatically generates the ADO connect string to the 'specials.mdb' database. You can visualize that string in the 'specials.mil' file:
Connection=Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\Documents and Settings\dcb.HQ\My Documents\specials.mdb;DefaultDir=C:\Documents and Settings\dcb.HQ\My Documents;ReadOnly=0;

Step 4 - Associate fields: Highlight the 'Contact' table that includes the fields. Match the 'Email' and/or 'Fax' address (compulsory) and 'Last Name' (optional) eMill fields with those of the database.
The application automatically generates the SQL queries to acquire the data records. You can visualize the queries in the 'specials.mil' file:
ReceiversQuery=Select [Amount],[Email],[Format],[Gender],[Name] From [Contact]
ReceiversCountQuery=Select Count(*) From (Select [Amount],[Email],[Format],[Gender],[Name] From [Contact]) As SourceTable

Step 5 - Create content: Two contents are automatically created at the end of the New Project Wizard. HtmlBody which is an html content file and TextBody which is the alternate text. The text version is displayed if the client settings specify 'text only'.

The following includes basic HTML tags with embedded AMS. Paste it inside 'HtmlBody' from the source mode of the html editor.

<HTML>
<HEAD>
<TITLE>Specials</TITLE>
</HEAD>
<BODY>

<!--The following command script checks the Gender field value from the database, providing an alternate sentence if the value is EMPTY or NULL-->
<% If CSafeStr(Record.fields("Gender") = "" Then %>
Dear valued customer,<BR><BR>
A short note to let you know
<% Else %>
Dear <%= Record.Fields("Gender") & ". " & Record.Fields("Name") & ",<BR><BR>"%>
As a valued customer,
<% End if %>

<!--All recipients receive this part of the message-->
you are entitled to fully benefit from our exclusive <B>Member Club</B> specials on any item from the Unlimited Hikers 2001 Winter Collection.<BR><BR>

Discover what our designers have been brewing over the past summer, all now available from our newly winterized <A HREF="http://www.unlimitedhikers.tld">store</A>.<BR><BR>

<!--A VBScript function is used within the AMS delimiters to generate the date-->
Specials last till <% Response.Write FormatDateTime(DateAdd("d",30,Now), vbLongDate)%>, so hurry up!<BR><BR>

<!--The following AMS statement checks whether the recipient has a credit on record and displays that amount, if not, the 30% discount offer is displayed-->
<% If CSafeStr(Record.Fields("Amount"))= "" Then %>
To top it all, we are throwing in an additional <B>30% discount</B> on last year's <A HREF="http://www.unlimitedhikers.tld/catalog.asp?stuff=old">gear</A>.
<%
Else
    Dim Gift
    Gift = Fix(Record.fields("Amount"))
%>
Our records show you currently own a cumulated $
<% Response.write Gift & " worth of <B>Gift Certificates</B>.<BR>That tops it all !" %>
<% End If %>

<BR><BR>
Expecting your visit soon,<BR><BR>
Unlimited Hikers Ltd.
</BODY>
</HTML>
Step 6 - Previewing messages: Save all project files and click on the Preview node. Use the records commands to display rendered messages.
Previewing applies the render individually for each recipient. If you have entered several database records as we did, you can scroll through other recipients and see how the content is conditionally generated.

Dear Mrs. Jones,

As a valued customer, you are entitled to fully benefit from our exclusive Member Club specials on any item from the Unlimited Hikers 2001 Winter Collection.

Discover what our designers have been brewing over the past summer, all now available from our newly winterized store.

Specials last till Saturday, November 03, 2001, so hurry up!

To top it all, we are throwing in an additional 30% discount on last year's gear.

Expecting your visit soon,

Unlimited hikers Ltd.

Dear Mr. Smith,

As a valued customer, you are entitled to fully benefit from our exclusive Member Club specials on any item from the Unlimited Hikers 2001 Winter Collection.

Discover what our designers have been brewing over the past summer, all now available from our newly winterized store.

Specials last till Saturday, November 03, 2001, so hurry up!

Our records show you currently own a cumulated $39 worth of Gift Certificates. That tops it all !

Expecting your visit soon,

Unlimited hikers Ltd.

Dear valued customer,

A short note to let you know you are entitled to fully benefit from our exclusive Member Club specials on any item from the Unlimited Hikers 2001 Winter Collection.

Discover what our designers have been brewing over the past summer, all now available from our newly winterized store.

Specials last till Saturday, November 03, 2001, so hurry up!

Our records show you currently own a cumulated $32 worth of Gift Certificates. That tops it all !

Expecting your visit soon,

Unlimited hikers Ltd.

The AMS is processed by the Script Host and the output is exactly what each recipient will receive. You can use any html tags and client-side scripts inside the html message content. Note that all email clients do not support client-side scripts or that scripts can be disabled from the client. Also note that the graphic is embedded inside the email file. We could have left the graphic on a server by specifying the http URL to the file (e.g. <IMG SRC="http://www.unlimitedhikers.tld/graphics/logos/happy_bear.gif">

Step 7 - Adding client-side scripts: If the message content sent is HTML, you can add effects using client-scripts. However, note that client-scripts are not executed by the Script Host on the server, but are sent out 'as is' and will run on the client. Therefore, it is not recommended to use client side scripts as most email clients may not support it.
Step 8 - Alternate formats: In the last 2 steps, we will look up the values of the database 'Format' field and transmit the content format according to recipients' preferences.
Alternate text: When creating an html content file from eMill, an alternate text file is generated along by default. The text version is displayed if the client settings specify 'text only'. The text version is encoded as one of the MIME parts of the email file. However, some recipients can express a format preference different than the one they set in their client. Therefore, we need to process the format preferences at the server prior to distributing the content.

Our first task is to produce the various formats the content will be offered in. Next, we will indicate the conditions when each contents are enabled.
  • From the Project / Add a content option, enter a name for the new content file and select the text file type. Display the content properties and be sure that "contains script code to be executed" is checked.

  • Copy and paste the following code inside the text editor:

<% If CSafeStr(Record.fields("Gender")) = "" Then %>
Dear valued customer, <%= vbCrLf & vbCrLf %>
A short note to let you know that you are entitled to fully benefit from our exclusive Member Club specials on any item from the Unlimited Hikers 2001 Winter Collection.
<% Else %>
Dear <%= Record.Fields("Gender") & ". " & Record.Fields("Name") & "," & vbCrLf & vbCrLf %>
As a valued customer, you are entitled to fully benefit from our exclusive Member Club specials on any item from the Unlimited Hikers 2001 Winter Collection.
<% End if %>

Discover what our designers have been brewing over the past summer, all now available from our newly winterized store at http://www.unlimitedhikers.tld

Specials last till <% Response.Write FormatDateTime(DateAdd("d",30,Now), vbLongDate)%>, so hurry up!

<% If CSafeStr(Record.Fields("Amount"))= "" Then %>
To top it all, we are throwing in an additional 30% discount on last year's gear at http://www.unlimitedhikers.tld/catalog.asp?
<%
Else
    Dim Gift
    Gift = Fix(Record.fields("Amount"))
%>
Our records show you currently own a cumulated $<% Response.write Gift %> worth of Gift Certificates. That tops it all!
<% End If %>

Expecting your visit soon,
Unlimited Hikers Ltd.
http://www.unlimitedhikers.tld
  • To generate a PDF format content file, select the Project / Add a Content, enter a name for the new content file and select create new content from file:
  • Browse for the location of 'HtmlBody.htm', display the content properties and be sure that "contains script code to be executed" and "Convert to PDF format" are checked.
Step 9 - Setting the conditions: Finally, you need to indicate the conditions when each contents are enabled.
Select HtmlBody in the left tree and click on View / Properties. Go to the Conditiond Tab, check "Test the following conditions" and click on Add. Fill in the 3 boxes:

- The first box displays all your database fields. Select the field that needs to be tested, in this exemple the "Format" field.

- The second box allows you to decide what kind of comparison you want to apply. Select "equal to".

- The third box allows you to write the value that should appear in the "Format" field. Write here HTML.

Thus, the HtmlBody content will be only sent to receivers whose "Format" field is equal to HTML.

Then, you just need to repeat the same steps for:

- the TextBody content. This is the alternate text for HtmlBody so you need to indicate the same conditions as HtmlBody.

- the Specials content indicating that it has to be only sent to receivers whose "Format" field is equal to TXT.

- the PDF content indicating that it has to be only sent to receivers whose "Format" field is equal to PDF.

Step 10 - Simulating: You can test your mailing either previewing each email file individually as we did in step 6, or, for large mailings, by checking the simulate option for all enabled outgoing queues.
Simulating is a good way to test the whole mailing process including the recipients email addresses. Email files are individually rendered and transmission is started for each message: The SMTP connection to all recipients is established, the 'Mail From' and 'Mail To' are sent, and a RESET is made after the 'Data' command to abort actual transmission of message.
© eMill 2001-2015 . All trademarks property of their owners.


Creating a script-enabled file

An Active Messaging Script-enabled content file is a text file with the .htm or .txt extension that contains either:
  • Text with server-side scripts
  • Text with HTML tags and server-side scripts
Active Messaging Scripts are enclosed inside <% and %> delimiters to differentiate them from the text or html content and from other client-scripts. If the email content file doesn't contain any script, the server will dispense with script processing, render the file in MIME format and send it to the client. If there are scripts included, the server will execute the scripts to dynamically generate either text or html before rendering. The following example you can try from the insert field option in eMill is an AMS command script inserted inside an html content file that returns the first name from a data source field 'FirstName', or 'Customer' if the field value is empty or null:
<HTML>
  <BODY>
  Dear <%=DefaultStr(Record.Fields("FirstName"),"Customer")%>,
  </BODY>
</HTML>
In all cases, the client only receives MIME parts of a message that are encoded text or html content files. Server-side scripts are not sent out but used by the server to dynamically generate some of the text or html content.

Script insertion:

To insert server-scripts inside an html file, switch to source mode from the html editor and type your script inside the document source using the same interspersing practices you would use with ASP. You can also use an external html editor and use the Create new content from file option to link your script-enabled file to your project.

To insert scripts inside a text file, use the text editor included with eMill or any other text editor and differentiate the script from the content using the <% and %> delimiters.

Note: Server-side scripts can be written separately from the content and included afterwards inside the content file at insert point. Doing so, the proper delimiters will be automatically generated around the script according to what script you specify (server-side or client-side).
Contains script code to be executed: Make sure this option is checked from the Content properties box whenever inserting server-side scripts. This will make the server aware there are server-side scripts inside the document.
AMS delimiters: <% and %> equate to <SCRIPT language=SERVERASP and >. You need not specify the AMS language; it is the server-side language by default and uses your regular Windows Script Host.
© eMill 2001-2015 . All trademarks property of their owners.


Working with the language

eMill allows only one server-side scripting language to be used inside the content files: Active Messaging Script (AMS). There is no notion of primary and secondary scripting language: the default scripting language enclosed between the <% and %> delimiters is Active Messaging Script. However, if you are including client-side scripts to your content files, those languages have to be specified (typically JavaScript or VBScript).

Server-side script commands:

Commands enclosed between the <% and %> must be valid Active Messaging Script commands. All VBScript functions are valid functions for Active Messaging scripts. A documentation for those is provided in the 'Platform SDK Documentation/Tools and Scripting' section of MSDN. The following script command you can try shows how the VBScript Now() function included to an html content file returns the current date and time, and is used by eMill to time-stamp the message. Note that the delimiters being used are those for AMS:
<HTML>
  <BODY>
  This email was generated on <%= Now() %>.
  </BODY>
</HTML>

Mixing content and server-side script commands:

You can include statements, expressions, procedures, or operators within <% and %> delimiters. You can also intersperse your script with content. The conditional VBScript If...Then...Else... statement can be used in AMS as follows:
<% If CSafeStr(Record.Fields("Gender"))="" Then %>
    Dear Customer,
<% Else %>
    Dear <%=Record.Fields("Gender") & " " & Record.LastName %>
<% End If %>
This AMS script works indifferently in a TXT or HTML file and will return 'Dear Customer' if the data source field value 'Gender' is null or empty. Otherwise, it will return a 'Dear Mr. Blow' greeting to Joe Blow. In this case, some built-in AMS objects have been used:

CSafeStr: will return an empty string if the data source field value is empty is null or empty.
Record.Fields: used to access the data source 'Gender' field values.
Record.LastName: used to access the generic 'LastName' eMill record field, which was associated to the data source field containing the last names during linking.

Server-side script generating the content:

Rather than interspersing content with script commands, you can also return content from within a script by using the AMS built-in object Response:
<%
Dim FirstLine
If CSafeStr(Record.Fields("FirstName"))="" Then
   Response.Write "Dear Customer," & vbCrLf
Else
   FirstLine = "Dear" & " " & Record.Fields("FirstName") & " " & Record.Fields("LastName") & "," & vbCrLf
   Response.Write FirstLine
End if
%>
This script can be used to conditionally generate the first line of a text or html email content file (format indifferent). It is very similar to an ASP script that would be used in the web context. We declared a variable 'FirstLine' that receives database name field values. We substitute a standard 'Dear Customer' string to the personalized first line if a problem occurs with the database 'FirstName' record field (null or empty value). Note that if we were certain the content file was html, we could also have returned html tags with Response.Write by inserting them between the quotes (e.g. Response.Write "Dear Customer,<BR>" instead of using the vbCrLf command).

White space in scripts:

AMS removes white spaces from commands included inside the content file. For other client-side scripting languages you may include, white spaces are preserved so that languages dependent upon position or indentation are correctly interpreted by the client. White space includes spaces, tabs, returns, and line feeds. The following server-side script commands all produce the same result:
<% Response.Write "Hello" %>

<%Response.Write"Hello"%>

<%
Response.Write "Hello"
%>

AMS comments:

AMS being processed on the server, there is no need to include comment tags to hide the scripts from the email clients that do not support scripting. All AMS commands are processed before content is sent.

Apostrophe-style comments are supported in AMS, including inside an output expression:
<%= Now() 'Anything following an apostrophe is a comment%>
Case Sensitivity: AMS is not case sensitive. For example, you can use either Record.Fields or record.fields to refer to the AMS fields collection of the record object.
© eMill 2001-2015 . All trademarks property of their owners.


Using variables and constants

A variable is a named storage location in the computer's memory that contains data, such as a number or a text string. The data contained in a variable is called the variable's value. Variables give you a way to store, retrieve, and manipulate values using names that help you understand what the script does.

Declaring and naming variables:

Even if you are not required in VBScript to declare a variable before using it, it is a good habit to develop because it helps prevent errors. Declaring a variable means telling the script engine that a variable with a particular name exists so that you can use references to the variable throughout a script. To declare a variable in VBScript, use the Dim, Public, or Private statement. For example:
<% Dim RenderDate %>
You can use the VBScript Option Explicit statement in an HTML or TXT file to require variables to be explicitly declared with the Dim, Private, Public, and ReDim statements. The Option Explicit statement must appear before any HTML text or script commands. This statement only affects AMS script commands that are written in VBScript.
<% Option Explicit %>
<HTML>
<BODY>
.
.
<%
  Dim RenderDate
  RenderDate = Date ' Date the message was processed
%>
.
.
Activity report on <%= RenderDate %>
.
</BODY>
</HTML>
For more information on these commands, see the VBScript Language Reference, which can be found at the Microsoft Windows Script Technologies Web site.

Variable scope:

The scope, or lifetime, of a variable determines which script commands can access a variable. Variables in AMS are declared inside content files and can be accessed by all commands inside the content file. There is no notion of global scope, or variables having a lifetime exceeding the execution of the script contained inside the content file. However, if you use outside procedures (script files that are called from the content scripts through the Server.Execute method), all declarations in these outside procedures also apply to the content scripts located after the Server.Execute command.

Session and application scope:

We have seen above that variables are accessible only in a single content file. To make variables accessible beyond, you can give them either session or application scope. Session-scoped variables are available at rendering time to all content files destined to a given recipient. Session has to be understood as the laps of time the render processes all the content files that make the email file. Application-scoped variables are accessible to all sessions of a mailing project. Application variables can be used to store information for all mailing recipients, such as a specific greeting or general values used throughout the mailing.

AMS provides two built-in objects into which you can store variables: the Session object and the Application object.

Session scope:

To give a variable session scope, store it in the Session object by assigning a value to a named entry in the object. For example, we can stamp each attachment of a multipart message creating n content files and including them all to a mailing project:
<HTML>
<BODY>
<-!
This is one of n attachments that are part of a single message.
The attachment number is determined by the rendering order.
The position can be set from the content properties box in eMill.
-!>
.
.
<%
  Dim i
  i = Session("AttachmentCount")
  Response.Write "Attachment # " & Session("AttachmentCount") & " out of " & Session("TotalAttachmentCount")
  i = i+1
  Session("AttachmentCount") = i
%>
</BODY>
</HTML>
The project global script will be customized as follows (edit the event accordingly from the global view):
Sub Mail_OnStartRender()
  Session("TotalAttachmentCount") = Mail.Contents.Count
  Session("AttachmentCount") = 1
End Sub
We initialized AttachmentCount when starting each message rendering with the Mail_OnStartRender event. We assigned to TotalAttachmentCount the total number of attachments per each user using the Contents collection of the Mail object. Inside each content file, we included a script that uses a counter and retrieved information from the Session object with the output directive Response.Write.

Application scope:

To give a variable application scope, store it in the Application object by assigning a value to a named entry in the object. For example, the following command stores an application-specific date stamp and circulation number in the Application object when the mailing project is rendered (using the Mailing_OnStartRender event in the global script). The i variable was declared at the beginning of the global script. The DataSource_GetRowCount method returns the total number of recipients since the email address is a compulsory data source field.
'(Declarations)
Option Explicit
Dim rst
Dim i
'End of (Declarations)

Sub Mailing_OnStartRender()
  Application("DistributionNumber") = DataSource_GetRowCount()
  i = Date
  Application("NewsletterDate") = i
End Sub
To retrieve information from the Application object, you can use the output directive Response.Write inside the content script:
<%
<HTML>
<BODY>
.
.
<%
  Response.Write "Issue date " & Application("NewsletterDate") & ", circulation " & Application("DistributionNumber")
%>
</BODY>
</HTML>
We could have achieved the same result without using the i variable: Application("NewsletterDate") = Date. Note that variables used inside the global script and those used inside the content scripts must be respectively declared. Their lifetime expires after execution of each script.

Using constants:

A constant is a name that takes the place of a number or string. Some of the base components provided with Windows, such as ActiveX Data Objects (ADO), define constants that you can use in your scripts. For instance, the ADO constant definition file adovbs.inc stores cursor type values that you can use with Recordset objects, and usually resides in the Windows Program Files folder.

The following example puts the name, position and email addresses of all recipients at the bottom of each message. To try it out, you need to create a project database with FirstName, LastName, Position and Email in a Contact table. The purpose of the content script is to open a connection and acquire the records from the data source. The adOpenDynamic cursor type allows all types of movements through the recordset, while adLockOptimistic locks data source records only when the update method is invoked. Both values are defined in adovbs.inc and accessed through the Server.Execute method.
<HTML>
<BODY>

<%
  Dim Connect 'the connection
  Dim rst 'the recordset

  'retrieve the constant definition file from the system
  Server.Execute "C:\Program Files\Common Files\System\ado\adovbs.inc"

  'create and open the connection
  Set Connect = Server.CreateObject("ADODB.Connection")
  Connect.Open Mailing.connectString

  'create and open the recordset
  Set rst = Server.CreateObject("ADODB.Recordset")
  rst.Open "SELECT * FROM Contact", Connect, adOpenDynamic, adLockOptimistic

  Response.Write "This activity report was also sent to:<BR>"
  If Not rst.BOF Then
    Do
      Response.Write rst.Fields("FirstName") & " " & rst.Fields("LastName") & ", " & rst.Fields("Position") & ", " & "<A HREF=mailto:" & Chr(34) & rst.Fields("eMail")& Chr(34) & ">"& rst.Fields("Email") & "</A>, "
      rst.MoveNext
    Loop While Not rst.EOF
  End If

  'close the recordset and the connection
  rst.close
  Connect.Close
%>
</BODY>
</HTML>
You cannot declare a type library using the html <METADATA> tags and DLLs or UUIDs as you would with ASP. You have to use the Server.Execute method in conjunction with .inc constant definition files as illustrated above.
© eMill 2001-2015 . All trademarks property of their owners.


Working with collections

Several AMS built-in objects provide collections: Mail, Record, Application, Request, and Session.

Collections are data structures you can use to store items such as strings or numbers. Unlike arrays that have fixed dimensions, collections expand and contract automatically as items are added or removed. Items stored inside collections can be accessed by their index (position number, starts a 0), by iterating through all items, or by specifying a key name identifying the item.

Using collections of an object:

Collections can be used to effectively share information within a session (the rendering process of an individual message), or within a mailing (the whole process of rendering all messages). Example of a script written in the global script event Mailing_OnStartRender() that passes information to all receivers using the Contents collection of the Application object:
Sub Mailing_OnStartRender()
  Application.Contents("DataStamp") = Now()
End Sub
Used along with the content script command:
.
.
Information above was compiled from a database accurate up until <%=Application.Contents("DataStamp")%>
.
.
You need not specify the collection name if it is the implicit collection for the object. This command works also in the script shown above:
<%= Application("DataStamp") %>
Eliminating the collection name is safe when you are accessing items stored in the Application or Session objects, which only use the implicit Contents collection.

Accessing a collection item by name, index or iteration:

You can access a specific item in a collection by referencing its unique name (string key). For example, the Fields collection of the Record object holds the database field values (variants) acquired through the ADO connect string and SQL queries created for your project.

Suppose you have linked your project to a database and the first and second fields acquired (showing from the receivers view) are the FirstName and LastName fields. You can return per each rendered mail (per each script execution) the value of the fields using the following script commands and key names:
First Name: <%= Record.Fields("FirstName")%>
Name: <%= Record.Fields("FirstName")%>
You can also render the same values using the index notation:
First Name: <%= Record.Fields(0)%>
Name: <%= Record.Fields(1)%>
However, the index associated with an item might change as items are added to or removed from the collection. Indexed access should be used only to iterate through a collection. Example using the Tos and CCs collections of the Mail object. For this script to work, you have to specify an individual email file must be rendered per each recipient (from the General Properties box), and also set the CCs collection inside the global script (if your database provides a field to store carbon copy addresses):
Sub Mail_OnStartRender()
  Mail.CCs("copied") = Record.Fields("CarbonCopy")
End Sub
And inside the content script, you can then write the following script that will list all recipients of the message, using iterations through collections:
.
.
This message was addressed to:

<%
Dim i
For Each i In Mail.Tos
Response.Write(Server.HTMLEncode(Mail.Tos(i))) & "<BR>"
Next
%>
And also copied to:

<%
Dim y
For Each y In Mail.CCs
Response.Write(Server.HTMLEncode(Mail.CCs(y))) & "<BR>"
Next
%>
AMS supports the Count property, which returns the number of items in the collection. You can also use the Count property to specify the end value of the counter. The following would have worked above:
<%
Dim y
For y=0 to Mail.CCs.Count-1
  Response.Write(Server.HTMLEncode(Mail.CCs(y))) & "<BR>"
Next
%>
Note that we have to iterate from 0 (first item position in a collection) to Object.Collection.Count-1.
Shorthand notations: For all AMS objects providing several collections, you have to specify the collection name. This is a difference with ASP that allows you to access items in an object's collection without necessarily specifying which collection of the object.
© eMill 2001-2015 . All trademarks property of their owners.


Writing procedures

A procedure is a group of script commands included within AMS delimiters that performs a specific task and can return a value. You can include procedures inside the content files or define outside procedures that you can call repeatedly from the content using the Server.Execute or Server.Transfer methods. Note the #include directive used in ASP to include outside procedures is not implemented in AMS.

Defining procedures:

Procedures inside content files can only be included within the primary scripting language delimiters (<% and %>). You cannot specify any other server-side scripting language. For instance, the RUNAT=SERVER attribute inside an <SCRIPT> tag has to be avoided. Such tags can only be used to specify the client-side language.

In the following example, we are assigning data source field values to project variables using the Record object (when fields are acquired through the project connect string), and by creating an additional recordset (for database fields not accessed from the project connect string).
<%
' assigning field values retrieved from the project connect string
sName = Record.Fields("FirstName") & " " & Record.Fields("LastName")
lContactID = Record.Fields("ContactID")

' creating a new recordset
Set rst = CreateObject("ADODB.Recordset")
rst.Open "SELECT Number, AccountID FROM Account WHERE Account.ContactID=" & lContactID, Mailing.ConnectString

' testing the recordset values
If rst.BOF Then
  Response.Write "No accounting info available for this recipient"
  Response.End
  fRender = False

' assigning values from the newly acquired fields
Else
  sAccountNum = rst.Fields("Number")
  lAccountID = rst.Fields("AccountID")
  rst.Close
  Set rst = Nothing
  Set rst = CreateObject("ADODB.Recordset")
  rst.Open "SELECT * FROM Operation WHERE AccountID=" & lAccountID & " ORDER BY Date", Mailing.ConnectString
  fRender = True
End If
%>
Avoid using script commands inside a procedure that are not part of the complete procedures. Commands that are not part of a procedure may cause unpredictable results because the code is executed in the following order: Script blocks in non-default languages are executed in order of appearance, then the inline code, and finally the script blocks in the default language. In addition, you cannot use the output directive <%= %> within a procedure (use for command scripts only). Instead, use Response.Write to render content in a procedure.

Calling outside procedures:

You can organize your scripts by writing a set of procedures that are either included inside the content file, or saved externally as a .vbs file. Using outside procedures is extremely helpful if you are using identical scripts for several mailing projects. Note that all procedures have to be written in VBScript with optional inclusion of AMS objects. You cannot call procedures written in JScript for instance.

The following example shows a procedure that is included inside the content file using the sub definition. We assume the project is linked to a customer relational database, which provides information on the make and models of owned vehicles:
<HTML>
<BODY>
.
.
<%
' assign constant values per model
Const WRANGLER = 1
Const CHEROKEE = 2
Const LIBERTY = 4
Const GD CHEROKEE = 8

' connect to the customer database
Sub GetCustomerModel
  Dim rsModel
  Set rsModel = CreateObject("ADODB.Recordset")
  rsModel.Open "SELECT Products.* " &_
    "FROM Products, ContactProducts " &_
    "WHERE ContactProducts.ContactID = " & Record.Fields("ContactID") & " " &_
    "AND Products.ProductID = ContactProducts.ProductID;",_
    Mailing.ConnectString,3,3

  'retrieve customer model(s)
  Session("CustomerModel") = 0
  Session("ModelHave") = ""
  If Not rsModel.BOF Then
    Do
      Select Case rsModel.Fields("Reference")
        Case "W-SE", "W-SPORT", "W-SAHARA"
          Session("CustomerModel") = Session("ModelHave") + WRANGLER
          If Session("CustomerModel") = "" Then
            Session("ModelHave") = "Jeep Wrangler"
          Else
            Session("ModelHave") = Session("ModelHave") + ", Jeep Wrangler"
          End If
        Case "C-SPORT", "C-LIMITED"
          Session("CustomerModel") = Session("ModelHave") + CHEROKEE
          If Session("CustomerModel") = "" Then
            Session("ModelHave") = "Jeep Cherokee"
          Else
            Session("ModelHave") = Session("ModelHave") + ", Jeep Cherokee"
          End If
        Case "L-SPORT", "L-LIMITED"
          Session("CustomerModel") = Session("ModelHave") + LIBERTY
          If Session("CustomerModel") = "" Then
            Session("ModelHave") = "Jeep Liberty"
          Else
            Session("ModelHave") = Session("ModelHave") + ", Jeep Liberty"
          End If
        Case "G-LAREDO", "G-LIMITED", "G-OVERLAND"
          Session("CustomerModel") = Session("ModelHave") + GD CHEROKEE
          If Session("CustomerModel") = "" Then
            Session("ModelHave") = "Jeep Grand Cherokee"
          Else
            Session("ModelHave") = Session("ModelHave") + ", Jeep Grand Cherokee"
          End If
       End Select
       rsModel.MoveNext
       Loop While Not rsModel.EOF
     End If
  rsModel.Close
  Set rsModel = Nothing
End Sub
%>
.
.
<%
  'create customized content by calling an external procedure
  Server.Execute("specials.vbs?CustomerModel=" & Session("CustomerModel"))
%>
.
.
</BODY>
</HTML>
The external procedure is preferably a VBScript file with AMS objects included. In this particular example, we will use a file (specials.vbs, called from the script above), which includes both html and scripts:
<!-- Nice html layout here. Remove the <HTML> and <BODY> tags if designed with an editor-->
<DIV ALIGN=CENTER>
<TABLE BORDER="0" WIDTH="480" CELLSPACING="1" CELLPADDING="0">
.
.
<%
  'check if customer owns a CHEROKEE, if so, render the following html
  If (Request.QueryString("CustomerModel") And CHEROKEE)=0 Then
%>
<!-- Time to change your rig! Run LIBERTY ad, include URLs to specials on a webserver, etc. -->
<TR>
  <TD>
  .
  .
  </TD>
</TR>
<%
  End If
  'check if customer owns a WRANGLER, if so, render the following html
  If (Request.QueryString("CustomerModel") And WRANGLER)=0 Then
%>
<!-- Recall: Fuel gauge needs fix. Include URLs to MOPAR accessories, etc. -->
<TR>
  <TD>
  .
  .
  </TD>
</TR>
<%
.
.
<% End If %>
.
.
</TABLE>
</DIV>

Passing arrays to procedures:

You can still use arrays to pass information inside scripts as you would with VBScript. However, a much better strategy with AMS is to use collections. Example of the use of arrays:
<%
'retrieve highest and lowest license price from the database
  Function GetPrice(sSize)
    Dim rsPrice
    Set rsPrice = CreateObject("ADODB.Recordset")
    rsPrice.Open "SELECT * FROM Table1 WHERE SIZE = '" & sSize  & "';",_
      Mailing.ConnectString, 3, 3
    If Not rsPrice.BOF Then
      GetPrice = rsPrice.Fields("PRICE")
    Else
      GetPrice = 0
    End If
    rsPrice.Close
  End Function

' make array to store highest and lowest price on article
Dim aDress(2)
aDress(0) = GetPrice("SIZE-S")
aDress(1) = GetPrice("SIZE-XL")
%>
.
.
From $<%=CCur(aDress(0))%> (size S) to $<%=CCur(aDress(1))%> (size XL) only!
.
.
© eMill 2001-2015 . All trademarks property of their owners.


Interacting with other scripts

AMS is the primary server-side scripting language and does not allow other server-side languages to run simultaneously on the host. You can however generate or manipulate client-side scripts with AMS if the content you send is in html. Be aware there is no warranty that the scripts served to email clients will run since a fraction of email software are not script-enabled.

You can write server-side scripts that assemble client-side scripts and one way to do that is by interspersing AMS server-side script statements within client-side scripts:
<HTML>
<BODY>
<SCRIPT language=JavaScript>
i = "<%=Record.Fields("FirstName")%>";
document.write("Hello ");
<%
If CSafeStr(Record.Fields("FirstName"))="" Then
%>
document.write("there!");
<% Else %>
document.write(i);
<% End If %>
</SCRIPT>
</HTML>
</BODY>
Another way to write this example is to use the server-side Response.Write output directive to assemble the client-side script:
<HTML>
<BODY>
<SCRIPT language=JavaScript>
<% If CSafeStr(Record.Fields("FirstName"))="" Then %>
document.write("Hello there!");
<%
Else
Response.Write "document.write(" & Chr(34) & "Hello " & Record.Fields("FirstName") & Chr(34) & ");"
End If
%>
</SCRIPT>
</HTML>
</BODY>
Another option would be to conditionally serve client-side scripts:
<HTML>
<BODY>
<% If CSafeStr(Record.Fields("FirstName"))="" Then %>
<SCRIPT language=JavaScript>
document.write("Hello there!");
</SCRIPT>
<% Else %>
<SCRIPT language=JavaScript>
i = "<%=Record.Fields("FirstName")%>";
document.write("Hello ");
document.write(i);
</SCRIPT>
<% End If %>
</HTML>
</BODY>
© eMill 2001-2015 . All trademarks property of their owners.


Sending content to the client

AMS is used to dynamically generate html or txt message content that is subsequently rendered in a format email clients can execute: MIME (Multipurpose Internet Mail Extensions). The major difference here with ASP is that the end result is encoded so as to be displayed in mail clients. Note that even if you are sending html message content to an email client, that client still requires the html to be encoded in MIME in order to work.

Email file and MIME parts:

An email file (EML) is made of several MIME parts, separated by boundaries. Boundaries define the limits of all files and resources that make up the message. For instance, a single html message with images will be rendered with boundaries that separate the html part (master document) from the included images (component parts). Reference to the component parts from the master document is done through the cid: (Content-ID). This scheme supposes all parts are inside the message.

Boundaries and Content-IDs are generated by the render and values are supposed to be unique.

You can view all parts of the MIME-encoded email file from the Preview and selecting Source.

Message headers are always rendered as the first part of the email file. Clients use the various tags to display the sender, the message subject, the date and other information. A typical header looks like this:
X-Receiver: postmaster@emilltest.com
X-Sender: postmaster@emilltest.com
From: postmaster@emilltest.com
X-Priority: 3
Date: Mon, 17 Dec 01 16:22:39 +0100
Mime-Version: 1.0
To: vince@emilltest.net
Content-Type: multipart/mixed;
Messages include several content files that are encoded inside the same email and assigned a unique Content-ID. Each part carries additional headers that help identify the application required to view the content, how it was encoded and how it is to be presented inside the client. For instance:
Content-Disposition: inline; filename="HtmlNote.htm"
Content-Transfer-Encoding: 7bit
Content-Type: text/html; charset=iso-8859-1
X-Content-Name: HtmlNote
Position of the MIME parts determine the display order of the content inside the client. The order can be changed from the eMill application. The Message Note content is always displayed first. You can specify what content is the message note from the Content Properties box. The Content-Disposition tag lets you control the disposition of each content inside the client (inline or attachment), and is also set per each file from the same application box. The default TextNote and HtmlNote content files are set to 'message content' by default, and if changed, can be displayed attached or inline in a specified order.

Content type and MIME encoding:

Each MIME part of a message can receive a Content Type value specifying what application can open the content. Content Type is usually determined automatically using the file name extension and the mapping as it is set in the system. For instance, if Excel is installed on your machine, attaching an .xls file to a message will generate the application/vnd.ms-excel content type string, and indicate to the receiving client what application to launch in order to open the attachment.

Entering a content type from the Content Properties box supersedes the content type detected from the file extension mapping.

You can also use the ContentType property of the Response object to set the content type at rendering time, if the extension is not commonly recognized by clients. This supersedes all prior content type affectations.

eMill defaults the MIME encoding (Content-Transfer-Encoding) to the optimized value in terms of size (Auto, Base64, Quoted-Printable, Text 8 bit). Reducing the size is not always advisable especially if you send binary files. You can similarly set the encoding mode from the Content Properties or from the global script.

For example, if you are sending an encapsulated postscript file (chart1.eps) as an attachment, you can set the content type programmatically from the global script. Receiving clients will then identify eps as a postscript file and look for an application to try to open it:
Sub Mail_OnStartRender()
  Mail.contents("chart1").headers("Content-Type") = "application/postscript"
  Mail.contents("chart1").Headers("Content-Transfer-Encoding") = "quoted-printable"
End Sub
This global script will generate the Content-Type and Content-Transfer-Encoding headers:
Content-Disposition: attachment;
filename="chart1.eps"
Content-Transfer-Encoding: quoted-printable
Content-Type: application/postscript
X-Content-Name: chart1

Case of reserved characters inside content files:

The render parses files in order to generate the email file. Some characters that you wish to render such as '<' and '>' may be interpreted as html tags and skipped, or generate errors. The URLEncode and HTMLEncode methods of the Server object allow you to safely render strings that can include any character or spaces. This is especially relevant if the strings are generated from a server-side process. Example:
<%
Dim i
  For Each i In Mail.Tos
    Response.Write(Server.HTMLEncode(Mail.Tos(i))) & " "
  Next
%>
Mail.Tos(i) will return a string with the following format:
"Name" <xyz@anything.com>
Not using the method above, <xyz@anything.com> would have been interpreted as an unknown html tag and hidden by mail client.

URLEncode is useful if you want to pass a URL as a parameter to a web server. It requires the server to un-encode the URL at the receiving end.

Case of images inside html content files:

The point in sending html files to clients is to have appealing layouts with graphics displayed. Images can be either embedded inside the message, or served by a web server when the client opens the email file, if throughput or file size is an issue.

To leave images on a server, use the following type of URL inside the html content:
<IMG SRC="http://www.imagedistribution.tld/graphics/logo.gif>
To embed images inside the email file, use a URL relative to the content file that does not include the address of a web server. Example:
<IMG SRC="pictures/logo.gif>
The render will retrieve the image file, encode it in Base64 (default), assign a content ID to it, and append it to the email file between boundaries. The rendered html source calling the image will be:
<IMG SRC=3D"cid:650f2bf7683a4cff6a3ed5aa38afd919">
And the appended image:
--====a0cf17f5614542a30d9583b0432a7030==
Content-Transfer-Encoding: base64
Content-ID: 650f2bf7683a4cff6a3ed5aa38afd919
Content-Type: image/gif
X-Content-Name: logo.gif
.
.
--====a0cf17f5614542a30d9583b0432a7030==
Note: Embedding images, the client needs not to connect back after downloading the message. Leaving images on the server is often used for reporting which clients have actually opened the message.

Case of URLs inside html content files

URLs inside html content files can also be used to link to other content files that become part of the message. You can opt to keep those files on a web server just by supplying addresses of files on a website. Doing so, you can pass parameters, and deliver content using regular dynamic web techniques. Example using ASP:

This AMS script is included inside an email html content prior to rendering:
.
.
<%Response.Write "http://www.activeplus.com/getkey.asp" & "?id=" & Server.URLEncode(Record.Fields("Email"))%>
.
.
The email client receives this:
.
http://www.activeplus.com/getkey.asp?id=john@emilltest.net
.
Clicking on the link from the email client, the web browser is launched and points to the getkey.asp file on the web server. The server application can retrieve the email address, which identifies the user in the database and serve content accordingly.
<%
Dim sEmail
sEmail = Request.QueryString("id")
'This retrieves the email address of those who log back on the site.
'This address was already in my database.
'From there I can do any sort of web application...
.
.
%>
You can also opt to send linked content files along with the message. Supplying a URL to a file that does not include the address of a web server will embed it to the email file. This amounts to sending 'websites' that are viewed and can be browsed through from inside the email client (some clients have limitations). For instance, linking a cebu.htm file from the HtmlNote as follows...
.
.
Cruise destinations:
<UL>
<LI><A HREF="cebu.htm">Cebu</A>
<LI>...
.
... produces the following email file where cebu.htm is rendered and appended as another MIME part of the message:
.
Cruise destinations:
<UL>
<LI><A href=3D"cid:c987cd75d5984f35fa3a1a80276f2ec9">Cebu</A>
.
.
.
--====7e0686b24b5c4c3363e15fa5e78b9901==
Content-Transfer-Encoding: base64
Content-ID: c987cd75d5984f35fa3a1a80276f2ec9
Content-Type: text/html X-Content-Name: cebu.htm
.
.
Note that you need not add cebu.htm to the mailing project (no record of that file is in the .mil project file). As long as the URL points to a file that is not on a web server, the file is added to the message note. If cebu.htm had itself AMS server side scripts included, it would have had to be linked to the project through the New Content/Create new content from file box, with the Contains script to be executed option checked.

Delivering HTML, TXT or PDF conditionally:

Receivers may have preferences as per which format they want their email. AMS lets you programmatically set the format according to database records. You need not produce several variations of the same content. The default content created when starting a project is html (HtmlNote), and an alternate text version is automatically generated through the HtmlToText function inserted inside the TextNote:
<%
  Response.Write HtmlToText(Mail.Contents("HtmlNote").Data)
%>
The TextNote will need some editing if you use cell padding or embedded URLs inside your HtmlNote. You can also quickly create a PDF version from the HtmlNote through the New Content/Create new content from file box, selecting HtmlNote, changing name to PdfNote and checking the Convert to PDF format.

If your database has a PreferredFormat field, you can serve the content according to user preferences from the global script:
Sub Mail_OnStartRender()
  If Record.Fields("PreferredFormat") = "pdf" Then
    Mail.Contents.Remove("HtmlNote")
    Mail.Contents.Remove("TextNote")
  ElseIf Record.Fields("PreferredFormat") = "html" Then
    Mail.Contents.Remove("PdfNote")
    Mail.Contents.Remove("TextNote")
  Else
    Mail.Contents.Remove("PdfNote")
  End If
End Sub
Note that if the user preference is txt or not specified (last case), the HtmlNote from which the TextNote is derived is not removed. Removing it would require you not to use the HtmlToText function to create the text content but to supply actual text content. The usual practice is that when both text and html are sent to the client, a header indicates the text is an alternative part of a following related part (html):
--====2eb127c4f9894f21a94a108132f99e84==
Content-Type: multipart/alternative;
  boundary="====74447ced8fc144f3d487d98de50f78a8=="
--====74447ced8fc144f3d487d98de50f78a8==
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=iso-8859-1
X-Content-Name: TextNote
.
.
--====74447ced8fc144f3d487d98de50f78a8==
Content-Type: multipart/related;
  boundary="====8ee134697e0848338a5bff8d4d78fc32=="
--====8ee134697e0848338a5bff8d4d78fc32==
Content-ID: 9e4281fca1a14b25761d43b7eb260346
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=iso-8859-1
X-Content-Name: HtmlNote
.
.
--====8ee134697e0848338a5bff8d4d78fc32==
Clients set to execute text only will skip the related html part.

Another way is to skip the creation of PdfNote and use the AMS X-PDF private header tag:
Sub Mail_OnStartRender()
  If Record.Fields("PreferredFormat") = "pdf" Then
    Mail.Contents("HtmlNote").Headers("X-PDF") = True
    Mail.Contents.Remove("TextNote")
  ElseIf Record.Fields("PreferredFormat") = "txt" Then
    Mail.Contents.Remove("HtmlNote")
  End If
End Sub
The X-PDF tag will not be received by the client but is used by the render to convert the part to pdf. All parts referred to are also converted.

© eMill 2001-2015 . All trademarks property of their owners.


Accessing a data source

AMS uses Microsoft's ActiveX Data Objects (ADO) technology to link to a data source. ADO's objects let you easily access the system-level OLE DB programming interface using VBScript. In addition to OLE DB compliant data sources, ADO also lets you access Open Database Connectivity (ODBC) compliant databases.

ADO connect strings:

eMill features a wizard to generate the ADO connect string to your data source. An ADO connect string is a series of semicolon-delimited arguments that define parameters such as the data source provider and the location of the data source. ADO uses the string to identify the provider, which is a component that exposes data source information in the form of row sets. The receivers view inside eMill is how this information is exposed to the application.

For background reference, the OLE DB connect strings used by ADO are:
Data Source | OLE DB Connection String
Microsoft® Access | Provider=Microsoft.Jet.OLEDB.4.0;Data Source=path to .mdb file
Microsoft SQL Server | Provider=SQLOLEDB.1;Data Source=path to database on server
Oracle | Provider=MSDAORA.1;Data Source=path to database on server
Microsoft Indexing Service | Provider=MSIDXS.1;Data Source=path to file
Note: All former ODBC connect strings are still supported by an OLE DB provider and can be used by ADO. Those strings will also be generated by eMill's wizard. Learn about ADO and OLE DB from Microsoft's website.

Connecting to a data source from scripts:

A mailing project is linked to a data source through an ADO connect string and SQL queries. We have seen that all records accessed are displayed from the receivers view, and the Fields collection of the Record object lets you instantly call the record field values from inside your scripts.

However, you may need for some applications to manipulate sets of records, or acquire additional fields that are not accessed through the project connect string. For instance, if your application requires you to compute the results from various field values, or if the database record fields you need access to are not in the current table or stored procedure, you will need to open a connection to the database from inside your scripts.

ADO provides the Connection object for establishing and managing connections between your applications and OLE DB compliant data sources or ODBC compliant databases. The Connection object features properties and methods you can use to open and close database connections, and to issue queries for updating information. To establish a database connection, create first an instance of the Connection object. Example:
<%
  'Create a connection object.
  Set cnn = Server.CreateObject("ADODB.Connection")
  'Open a connection using the OLE DB connection string.
  cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Data\Leads.mdb"
%>
The ConnectString property of the Mailing object lets you retrieve the connection string that is stored in the .mil project file. This method allows you to dispense with the use of the ADO Connection object for all access to the data source your project is linked to. The following example shows several methods of accessing a data source.

We assume the data source is a Microsoft Access relational database with a Contact table (ContactID, FirstName and LastName fields) and a Balance table (ContactID, Description, Loan, Payments and Installments fields). The project was initially linked to the Contact table.

Case 1 - You can assign values to variables directly through the Record object if the values are from fields inside the table your project is linked to:
<%
  'Use field values directly acquired through the Record object
  'The project is linked to the Contact table containing the fields
  Response.Write "<B>First Name: </B>" & Record.Fields("FirstName") & "<BR>"
  Response.Write "<B>Last Name: </B>" & Record.Fields("LastName") & "<BR>"
%>
Case 2 -To retrieve database values from fields located inside other tables of the database, open a new connection using the ConnectString property of the Mailing object, and create recordsets to manipulate the data:
<%
  'Create a recordset to store values from fields in other tables
  'Open connection using the project string stored in ConnectString
  'Define SQL SELECT statement and list tables including the fields.
  Set rst = CreateObject("ADODB.Recordset")
  rst.Open "SELECT Balance.Installments, Balance.Description, Balance.Payments, Balance.Loan FROM Contact INNER JOIN Balance ON Balance.ContactID=Contact.ContactID WHERE Contact.ContactID="&Record.Fields("ContactID")&";", Mailing.ConnectString
  If rst.BOF Then
    Response.Write "No records available for this Customer"
    Response.End
  Else
    sDescription = rst.Fields("Description")
    sInstallments = rst.Fields("Installments")
    sPayments = rst.Fields("Payments")
    sLoan = rst.Fields("Loan")

    Response.Write "<B>" & sDescription & ": </B>" & sInstallments & "<BR>"
    Response.Write "<B>Payments received: </B>" & sPayments & "<BR>"
    Response.Write "<B>Total paid back: </B>" & (sPayments * sInstallments) & "<BR>"
    Response.Write "<B>Loan: </B>" & -sLoan & "<BR>"
    Response.Write "<B>Outstanding: </B>" & -((sPayments * sInstallments) + sLoan) & "<BR>"

    rst.Close
  End If
%>
Case 3 - To write to another data source the project is not linked to, open another connection with the appropriate string. The following will store information about the recipients of the mailing above into an Excel file:
<%
  'Write send report to an Excel file the project is not linked to
  'Define the OLE DB connection string and the physical path
  strExcelConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Mailings\55072\report.xls;Extended Properties=""Excel 8.0;"""

  'Instantiate the Connection object and open a database connection.
  Set cnn = Server.CreateObject("ADODB.Connection")
  cnn.Open strExcelConnect
  'Define SQL INSERT statement.
  strSQL = "INSERT INTO [Sheet1$] (Email, FirstName, LastName, LastSent) VALUES ('" & Record.Fields("Email") & "','" & Record.Fields("FirstName") & "','" & Server.HTMLEncode(Record.Fields("LastName")) & "','" & Now & "');"
  'Use the Execute method to issue a SQL query to database.
  cnn.Execute strSQL,,adCmdText + adExecuteNoRecords

  cnn.Close
  Set cnn = Nothing
%>

Executing SQL queries:

The 4 more important SQL statements used inside queries are:
  • SELECT: Use to retrieve data from one or more tables.
    This query will return the name and email address of all people, male, over 65 from the Contact table. Name, Email, Gender and Age are all fields of the Contact table:
    SELECT Name, Email FROM Contact WHERE Contact.Age = 65 AND Contact.Gender = 'male'
  • INSERT: Use to add new records (rows of data) to a table.
    This query adds to the Report table records rendered from a mailing table:
    INSERT Report (SentName, SentEmail) VALUES ('<%Record.Fields("Name")%>',  '<%Record.Fields("Name")%>')
  • DELETE: Use to remove records from a table.
    This query deletes all rows from the Contact table where the Email field is empty (NULL):
    DELETE * FROM Contact WHERE Email = IS NULL
  • UPDATE: Use to update the individual fields (columns) in a record.
    This query updates the LastSent field of the Contact table with the server date returned from the Now function:
    UPDATE Contact SET Contact.LastSent = ('<%Now%>')
IMPORTANT: The AMS command scripts above should not include the script delimiters when the query is itself used inside a script. You need to replace:
('<%Record.fields("Name")%>', ...)
with:
"('" & Record.Fields("Name") & "', " & "..." & ")"
A good reference of basic SQL statements and their keywords is available at DevGuru.

Note: AMS supplies the ReceiversQuery and ReceiversCountQuery from the Mailing object that return from inside the scripts the SQL query that acquires the list of recipients and the receivers count.

Using recordsets to manipulate results:

ADO provides the Recordset object for retrieving or making changes to database records (rows). Recordsets receive database records returned by an SQL query, maintaining their position so you can cycle through each row. Examples above show how to use the Open method of the Recordset object to establish a connection to the database. For information about other properties and methods, log onto Microsoft's website.

Modifying database records:

AMS provides handles to automatically change database records after each mailing. The following example updates the LastSent field of the database after the mailing is rendered.
Sub Mailing_OnEndRender()
  Dim sSentDate
  Dim sQuery
  Dim Conn

  sSentDate = Date
  Set Conn = CreateObject("ADODB.Connection")
  Conn.Open Mailing.ConnectString
  sQuery = "UPDATE Contact " & "SET LastSent = #" & sSentDate & "#;"
    Mailing.AppendToLog sQuery
    Conn.Execute sQuery 'execute the query
    Conn.Close 'Close the connection
    Set Conn = Nothing
End Sub
To automatically update the project database from mailing replies, look into the Mailing_OnAcceptMail and Mailing_OnReceiveMail events of the webletter sample that illustrates how to automate the REMOVE, UNSUBSCRIBE, SUBSCRIBE and UPDATE cases. You will need to define incoming queues and subscribe your project inbox to a queue.

Customizing data source access with the DataSource object:

eMill usually connects to databases with ADO. However, if you need customized access, or if the data source is not ADO compliant, you can use the DataSource object inside the global script, and check the Use global script to access datasource option from the Project Properties/Data Source box. The samples provide an example showing how you can connect to an XML database using DataSource and its methods.
© eMill 2001-2015 . All trademarks property of their owners.


Debugging AMS

At design stage, you can use the preview to instantly test your content or global scripts. If an error occurs while an AMS script is running, the application displays a Run-Time error message. The name of the content file (attachment) that has a bug is displayed, as well as its location and a description of the problem:
The message will state a bug in Milset.vbs if the bug resides in the global script.
  • Click on Continue to ignore the bug and return to the preview.
  • Click on End to abort rendering (preview).
  • Click on Debug to launch your default debugger.

Microsoft Script Debugger:

If your default debugger is Microsoft Script Debugger (recommended), the debugger application will load two modules from the eMill application. One module is the VBScript code that will, once rendered, produce the MIME content of the message that the selected recipient will receive:
Recipients are selected individually from the preview, using the record editor commands.

The other module is the VBScript global script code that provides the various mail / mailing events:
The debugger will generate a breakpoint at the location the error was encountered. You can troubleshoot the problem from inside the debugger. Note that modifications to the code from inside the debugger will not be transferred back to your scripts inside eMill.
Important: Use the 'Stop Debugging' option from your debugger to return to eMill. If you quit your debugger application without stopping it, the eMill application will crash.
© eMill 2001-2015 . All trademarks property of their owners.


Scripting Object Reference Cards

eMill implements the following built-in object classes. These objects are accessible by script-enabled content files.
Class | Use to
Mailing | Access information about your mailing project.
 | Name, Path, ConnectString, ReceiverQuery, BlackListConnectString, BlackListQuery, CodePage, LCID, Published
 | AbortRender, CreateMail, SubmitMail, RemoveReceivedMail
Mail | Access information about the mail currently being processed.
 | Headers, Receivers, Tos, CCs, Contents, CodePage, LCID, Sender, From, Subject, Date, Priority, AbortRender
 | OnEndRender, OnStartRender
Record | Call the collections, methods and properties of the record object.
 | Headers, Receivers, Tos, CCs, Contents, CodePage, LCID, Sender, From, Subject, Date, Priority, AbortRender
Application | Share information among all sessions of a given mailing project.
Request | Retrieve the values that the client passed to the server during an HTTP request.
Response | Send output to the rendered content.
 | Headers, Receivers, Tos, CCs, Contents, CodePage, LCID, Sender, From, Subject, Date, Priority, AbortRender
Server | Access to methods and properties on the server.
 | Headers, Receivers, Tos, CCs, Contents, CodePage, LCID, Sender, From, Subject, Date, Priority, AbortRender
Session | Store information needed during rendering for a particular receiver.
Soap | Call web service methods through the SOAP protocol.
eMill global script component:
DataSource | Implement data access to any non-ADO database.
eMill implements the following helper functions. These functions are accessible from any script.
Function | Use to
CSafeStr | Returns an expression that has been converted to a Variant or subtype String.
DefaultStr | Returns a default string if the passed expression is empty or null.
HtmlToText | Returns a text string from an HTML text.
EncodeBase64Str | Returns a base64 text string from any text string.
DecodeBase64Str | Returns a text string from a base64 encoded text string.
FormatEmailAddress | Returns a properly formatted email address.
ExtractEmailAddresses | Returns on or more email addresses from any text.
CreateUniqueID | Returns a 128 bit unique identifier formatted as a string.
GetHttpFile | Returns a Variant of subtype Byte array or String that contains the result of the HTTP request.
DecodeInternetDate | Convert an RFC822 datetime string to a variant of subtype Date.
IsJokerMatch | Dertermines if a string matches a pattern.

You can read the VBScript Reference guide at http://msdn.microsoft.com/scripting

Script Enabled Content File: A text file that contains script to be executed within <% %> delimiters, or a .vbs file.
©2001-2015 eMill . All trademarks property of their owners.


Mailing Object

You can use the Mailing object to access information about your mailing project.

Syntax

Mailing.collection|property|method

Properties
Name | Gets the project name.
Path | Gets the project root path.
ConnectString | Gets the ADO connect string.
ReceiversQuery | Gets the SQL query that returns the list of receivers records.
BlackListConnectString | Gets the ADO connect string.
BlackListQuery | Gets the SQL query that returns the list of blacklist records.
ListName | Gets the current receivers list name.
CodePage | Sets the default code page for this mailing. The code page tells eMill how to encode characters for different languages.
LCID | Sets the default LCID for this mailing. The LCID refers to how dates, times, and currency are formatted for a specific geographical locale.
Published | Gets the mailing published status.
Preview | Gets the rendered message preview status.
Profile | Gets the mailing configuration object.
Methods
AbortRender | This method aborts the entire mailing rendering process.
CreateMail | This method creates a new Mail object
SubmitMail | This method submits a Mail to the Outbox folder.
RemoveReceivedMail | This method removes the received message from the Inbox folder.
MoveReceivedMail | This method moves the received message to an Inbox sub folder.
AppendToLog | This method adds a string to the end of mailing log.
GetValue | This method gets a value from the mailing profile (the .mil file)
Events
Mailing_OnEndRender | This event is invoked when the mailing rendering has completed.
Mailing_OnStartRender | This event is invoked when a mailing is about to be rendered.
Mailing_OnAcceptMail | This event is invoked when a message is about to be received
Mailing_OnReceiveMail | This event is invoked when a message has been received.
Mailing_OnMailStatus | This event is invoked when a message status is changing.
Mailing_OnUrlClicked | This event is invoked when a receiver has clicked on a link within a tracked mail content or when a mail content was opened.

© 2001-2015 eMill . All trademarks property of their owners.


Session Contents Collection

The Session.Contents collection contains all of the items that have been established for a session. Information stored in the Session collections is available during a receiver session. The collection can be used to determine the value of a specific session item, or to iterate through the collection and retrieve a list of all items in the session. See the Collection Object for standard collection properties and methods.

Syntax

Item = Session.Contents(key|index)

Parameters
key
The identifier for the item to return.
index
An index offset indicating which item in the list to return. The index starts at 0
Settings and Return Values

Sets or returns a Variant value.

Remarks

The Contents collection is the Session object implicit collection. Therefore you do not need to specify .Contents when accessing the collection.

Example

Sub Mail_OnStartRender
Session("Credits") =
Record.Fields("Credits") * Application("CreditRatio")
End Sub

Applies to

Session Object

See Also

Application Contents Collection

©2001-2015 eMill . All trademarks property of their owners.


Mailing.ProjectName

Name

The Name property returns the mailing project name.

Return Value

Returns a String value.

Applies To

Mailing Object

See Also

Path

©2001-2015 eMill . All trademarks property of their owners.


Mailing.Path

Path

The Path property returns the mailing root path.

Return Value

Returns a String value.

Applies To

Mailing Object

See Also

Name

©2001-2015 eMill . All trademarks property of their owners.


ConnectString

The ConnectString property contains the information used to establish a connection to an ADO data source that stores the Receivers recordset.

Return Value

Returns a String value.

Remarks

See the ADO ConnectionString property for more details.

Applies To

Mailing Object

See Also

ReceiversQuery

©2001-2015 eMill . All trademarks property of their owners.


Mailing.ReceiversQuery

ReceiversQuery

The ReceiversQuery property returns the SQL query that returns the list of receivers.

Return Value

Returns a String value.

Applies To

Mailing Object

See Also

ConnectString

©2001-2015 eMill . All trademarks property of their owners.


Mailing.BlackListConnectString

BlackListConnectString

The BlackListConnectString property contains the information used to establish a connection to an ADO data source that stores the black list.

Return Value

Returns a String value.

Remarks

See the ADO ConnectionString property for more details.

Applies To

Mailing Object

See Also

BlackListQuery

©2001-2015 eMill . All trademarks property of their owners.


Mailing.BlackListQuery

BlackListQuery

The BlackListQuery property returns the SQL query that returns the list of receivers.

Return Value

Returns a String value.

Applies To

Mailing Object

See Also

BlackListConnectString

©2001-2015 eMill . All trademarks property of their owners.


ListName

The ListName property contains the name of the receivers list currently used to render the message.

Return Value

Returns a String value.

Remarks

This property may be useful to perform certain operations that are list specific when the mailing project use more than one receivers list.

Applies To

Mailing Object

See Also

ReceiversQuery

©2001-2015 eMill . All trademarks property of their owners.


Mailing.CodePage

CodePage

The CodePage property specifies how strings are encoded in the intrinsic objects. A code page is a character set that can include numbers, punctuation marks, and other glyphs. Codepages are not the same for each language. Some languages such as Japanese and Korean have multi-byte characters, while others like English and German only need one byte to represent each character.

Settings and Return Value

Sets or returns an Integer value

Remarks

Setting Mailing.CodePage explicitly affects the default code page for the mailing, where Mail.CodePage affects all content of a mail message.
You can find codepage values at MSDN Web Workshop under the column for FamilyCodePage.

Applies To

Mailing Object

See Also

Mail.CodePage , Response.CodePage

©2001-2015 eMill . All trademarks property of their owners.


Mailing.LCID

LCID

The LCID property specifies how dates, times, and currencies are formatted. LCIDs are not the same for each geographical locale. Some locales format dates as YY-MM-DD and some format dates as MM-DD-YYYY.

Settings and Return Values

Sets or returns an Integer value.

Remarks

Setting Mailing.LCID explicitly affects the default LCID for the mailing.

Response.LCID can be set multiple times in one content, and the date can be displayed each time; however, the codepage must be set once to show all the characters.

You can find locale integers at MSDN Library.

Applies To

Mailing Object

See Also

CodePage , Mail LCID, Response LCID

©2001-2015 eMill . All trademarks property of their owners.


Mailing.Published

Published

The Published property indicates whether the mailing project is running in design mode or if the project published.

Return Value

Returns a Bool value.

Comments

Returns True if the current mailing project is running in design mode, False if the project is published.

Applies To

Mailing Object

©2001-2015 eMill . All trademarks property of their owners.


Mailing.Preview

Preview

The Preview property indicates whether the message is rendered for preview.

Return Value

Returns a Bool value.

Comments

Returns True if the message is rendered for preview, False if the message is rendered in the Outbox queue folder for sending.

Applies To

Mailing Object

©2001-2015 eMill. All trademarks property of their owners.


Mailing.Profile

Profile

The Profile property returns the mailing configuration object, as an MS XML object.

Return Value

Returns an Object value.

Comments

The returned object is the Mailing configuration object. It allows direct access to the whole Mailing properties. Do not modify it, or the Mailing project may behave incorrectly.

Applies To

Mailing Object

©2001-2015 eMill. All trademarks property of their owners.


Mailing.AbortRender

AbortRender

The AbortRender method will abort the mailing rendering process. Previously rendered receiver will not be aborted.

Syntax

Mailing.AbortRender

Parameters
None
Example

Mail_OnStartRender
...
If bSomeFailure Then
Mailing.AbortRender
End If
End Sub

Applies To

Mailing Object

See Also

Mail.AbortRender

©2001-2015 eMill . All trademarks property of their owners.


CreateMail

The CreateMail method will create a new Mail Object.

Syntax

Mailing.CreateMail MailTemplate

Parameters
MailTemplate
An optional Variant that contains either a Mail Object, an RFC822 content stored in a Content Object or a path to an .eml file.
Remarks

This method can only be called during OnReceiveMail, OnMailStatus and OnUrlClicked events.

Example

See the OnReceiveMail example

Applies To

Mailing Object

See Also

RemoveMail, OnReceiveMail

©2001-2015 eMill . All trademarks property of their owners.


Mailing.SubmitMail

SubmitMail

The SubmitMail method will submit a message to the Outbox folder.

Syntax

Mailing.SubmitMail Mail

Parameters
Mail
A Mail Object
Remarks

This method can only be called during OnReceiveMail, OnMailStatus and OnUrlClicked events.

Example

See the OnReceiveMail example

Applies To

Mailing Object

See Also

RemoveMail, OnReceiveMail

©2001-2015 eMill . All trademarks property of their owners.


Mailing.RemoveMail

RemoveReceivedMail

The RemoveReceivedMail method will remove the received message from the Inbox folder.

Syntax

Mailing.RemoveReceivedMail

Parameters
None
Remarks

This method can only be called when processing a message during the OnReceiveMail event

Example

See the OnReceiveMail example

Applies To

Mailing Object

See Also

SubmitMail, OnReceiveMail

©2001-2015 eMill . All trademarks property of their owners.


Mailing_MoveReceivedMail

MoveReceivedMail

The MoveReceivedMail method will move the received message from the Inbox folder to a sub-folder of the Inbox folder.

Syntax

Mailing.MoveReceivedMail

Parameters
FolderPath
A String that indicates the path of the destination folder.
Remarks

Folder names must be separated using a forward slash (eg. "Sales/Jim").
The folder will be created if it does not exist.
This method can only be called when processing a message during the OnReceiveMail event.

Example

See the OnReceiveMail example

Sub Mailing_OnReceiveMail
If DSNType<>0 Then
MoveReceivedMail "DSN"
End If
End Sub

Applies To

Mailing Object

See Also

RemoveReceivedMail, OnReceiveMail

©2001-2015 eMill . All trademarks property of their owners.


Mailing.AppendToLog

AppendToLog

The AppendToLog method adds a string to the end of the mailing log.

Syntax

Mailing.AppendToLog string

Parameters
string
The text to append to the log file. The text does not have to end with a CR LF.
Remarks

The log file is named log.txt and is located in the mailing project folder.
This method may be called from any eMill script context.

Example

Sub Mailing_OnMailStatus(Status)
For Each sReceiver in Mail.Receivers
Mailing.AppendToLog "Receiver: " & sReceiver & " Status Code: " & Status
Next
End Sub

Applies To

Mailing Object

©2001-2015 eMill . All trademarks property of their owners.


GetValue

The GetValue method returns a value from the mailing profile (the .mil file).

Syntax

Mailing.GetValue section, key

Parameters
section
String that specifies the name of the section containing the key.
key
String that specifies the name of the key whose associated string is to be retrieved
Return Value

A Variant that contains the value

Example

sProjectDesc = Mailing.GetValue("Project", "Description")

Applies To

Mailing Object

©2001-2015 eMill . All trademarks property of their owners.


Mailing_OnEndRender

The Mailing_OnEndRender event occurs when rendering has completed.

Syntax

Sub Mailing_OnEndRender
. . .
End Sub

Parameters
None
Example

Sub Mailing_OnEndRender()
 Mailing.AppendToLog "Render has completed at " & Now
End Sub

Applies To

Mailing Object

See Also

Mailing_OnStartRender

©2001-2015 eMill . All trademarks property of their owners.


Mailing_OnStartRender

The Mailing_OnStartRender event occurs when rendering starts for a mailing. The Mailing_OnStartRender event is a good time for you to set any mailing-wide variables, because they will be set before any receiver is rendered.

Syntax

Sub Mailing_OnStartRender
. . .
End Sub

Parameters
None
Example

Sub Mailing_OnStartRender
Mailing("StockRate") =
GetStockRate("HOTJ")
End Sub

Remarks

[Remarks goe here].

Applies To

Mailing Object

See Also

Mailing_OnEndRender, Mail_OnStartRender

©2001-2015 eMill . All trademarks property of their owners.


Mailing_OnAcceptMessage

Mailing_OnAcceptMail

The Mailing_OnAcceptMail event occurs when a mail is about to be received. The mail message can be accessed using the intrinsic Mail object.

Syntax

Sub Mailing_OnAcceptMail(Accept)
. . .
End Sub

Parameters
Accept
A Boolean variable that should be set to True if the mail is accepted
Example

Sub Mailing_OnAcceptMail(Accept)
If Mail.Receivers(0) = "sales@emilltest.com"
Then
Accept = True
End If
End Sub

Remarks

When accessing a POP3 queue, the Mail Object will only be initialized with the mail header, the Contents collection will always be empty.
If the message is not accepted, the Accept variable should never be set to False, it should be left unmodified.

See Also

Mailing_OnReceiveMail

©2001-2015 eMill . All trademarks property of their owners.


Mailing_OnReceiveMail

The Mailing_OnReceiveMail event occurs after a message has been accepted. The mail message can be accessed using the intrinsic Mail Object.

Syntax

Sub Mailing_OnMailReceive
. . .
End Sub

Parameters
None
Example

Sub Mailing_OnReceiveMail
' Create a backup of the received message
Dim NewMail
Set NewMail = Mailing.CreateMail(Mail)
NewMail.Receivers.RemoveAll
NewMail.Receivers.Add , "backup@emilltest.com"
NewMail.Subject = Mail.Subject & " Received on: " & Now
Mailing.SubmitMail NewMail
Set NewMail = Nothing
' Forward the original mail to the sales department
 Mail.Receivers.RemoveAll
Mail.Receivers.Add , "sales@emilltest.com"
Mailing.SubmitMail Mail
Mailing.RemoveReceivedMail
End Sub

Remarks

A mailing project can listen to more than one incoming queue, mails arriving from all queues will trigger this event.

Applies To

Mailing Object

See Also

Mailing_OnAcceptMail, SubmitMail, RemoveReceivedMail

©2001-2015 eMill . All trademarks property of their owners.


Mailing_OnMailStatus

The Mailing_OnMailStatus event occurs when a message is being moved from the Outbox folder to either the Sent or Aborted folder. The Mailing_OnMailStatus event is a good time for you to place some code to update the receiver database. The intrinsic Mail Object will reflect the aborted or sent message.

Syntax

Sub Mailing_OnMailStatus(Status)
. . .
End Sub

Parameters
Status
The message status. It can be one of the following values:
11 = The message was successfully sent
12 = The message was partially sent
13 = The message was aborted
Remarks
The X-Receiver-Status header field contains detailed information about the failure reason.
Example

Sub Mailing_OnMailStatus(Status)
If Status = 13 Then
DisableContactEMail(Mail.Headers("X-Contact-ID"))
End If
End Sub

Remarks

The Mail Object is only initialized with the mail header; the Contents collection is empty.
The DataSource object is not available at this point. Direct Database access should be used.

©2001-2015 eMill . All trademarks property of their owners.


Mailing_OnUrlClicked

The Mailing_OnUrlClicked event occurs when a receiver has clicked on a link within a tracked mail content or when a mail content was opened.

Syntax

Sub Mailing_OnUrlClicked()
. . .
End Sub

Remarks

The Record collection exposes all fields that where selected in the Tracking fields setting.
You may use the Request.ServerVariables method to query information about the clicked URL and various other details:
Request.ServerVariables("URL") : Returns the URL that was clicked. If the URL is equal to "open" then it indicates that the user has opened the email in it's mail client.
Request.ServerVariables("URL_NAME") : Returns the link name.
Request.ServerVariables("REMOTE_ADDR") : Returns the IP address of the receiver who has clicked on the link.
Request.ServerVariables("HIT_DATE") : Returns the date of the link click or message opening.
Request.ServerVariables("HTTP_REFERER") : Returns a string containing the URL of the page that referred the request to the redirector.
Request.ServerVariables("HTTP_USER_AGENT") : Returns a string describing the client mail software that sent the request.

Example

Sub Mailing_OnUrlClicked()
If Record.Email = "jim@emilltest.com"
and Request.ServerVariables("URL") = "open" Then
Mailing.AppendToLog "Jim has opened
our mail"
End If
End Sub

See Also

Record collection, Request.ServerVariables

©2001-2015 eMill . All trademarks property of their owners.


Mail Object

You can use the Mail object to access information about the mail currently being processed. This can either be an outgoing message that is being rendered or an incoming message.

Syntax

Mail.collection|property|method

Collections
Headers | Contains the list of header fields
Receivers | Contains the list of receivers that will receive the mail
Tos | Contains the list of receivers that are displayed in the To: field
CCs | Contains the list of receivers that are displayed in the CC: field
Contents | Contains the list of content items (body and attachments).
DSNHeaders | Contains the list of DSN headers
DSNReceivers | Contains the list of DSN receivers
Fields | Contains the list of body fields
Properties
CodePage | Sets the default CodePage for all contents in the current mail. The codepage tells eMill how to encode characters for different languages.
LCID | Sets the default LCID for all contents in the current mail. The LCID refers to how dates, times, and currency are formatted for a specific geographical locale.
Sender | Sets the SMTP sender. By default the sender will be initialized using the From: field.
From | Sets the From: field.
Subject | Sets or gets the message subject.
Date | Sets or gets the message date.
SendDate | Sets or gets the message send date.
Priority | Sets or gets the message priority.
DSNEnvID | Sets the DSN ENVID parameter.
DSNReturn | Sets the DSN RET parameter.
DSNNotify | Sets the DSN NOTIFY parameter.
DSNType | Gets the DSN type.
Data | Sets or gets the MIME content.

Additional header fields can be set using the Headers collection

Methods
AbortRender | Aborts rendering for the current receiver.
Save | Saves the mail to the disk (.eml file).
Events
Mail_OnEndRender | This event is invoked when the mail has been rendered.
Mail_OnStartRender | This event is invoked when the mail is about to be rendered.
Remarks

When rendering a mailing, all receivers associated with the current DataSource record will be added to the Receivers collection. Attachments will also be added to the Contents collection. The Mail_OnStartRender event is a good place to perform any receiver specific initialization such as adding user specific mail attachment or changing some header fields.

©2001-2015 eMill . All trademarks property of their owners.


Mail Headers Collection

The Mail.Headers collection contains all message headers. The collection can be used to determine the value of a specific header item, or to iterate through the collection and retrieve a list of all items in the message header. See the Collection Object for standard collection properties and methods.

Syntax

Item = Mail.Headers(key|index)

Parameters
key
The identifier for the item to return.
index
An index offset indicating which item in the list to return. The index starts at 0
Return Value

Returns a variant.

Remarks

The key should not contain the column character ':'

Example

In the following example, a Reply-To: header field is set on the Mail_OnStartRender event

Sub Mail_OnStartRender
Mail.Headers("Reply-To") = """Jim Wilson"" <jim.wilson@emilltest.com>"
End Sub

In the following example, the Reply-To: header field is removed on the Mail_OnStartRender event

Sub Mail_OnStartRender
Mail.Headers.Remove("Reply-To")
End Sub

Applies To

Mail Object

©2001-2015 eMill . All trademarks property of their owners.


Mail Receivers Collection

The Mail.Receivers collection contains all message receivers. The collection can be used to determine the value of a specific receiver item, or to iterate through the collection and retrieve a list of all receivers. See the Collection Object for standard collection properties and methods.

Syntax

Item = Mail.Receivers(key|index)

Parameters
key
The identifier for the item to return.
index
An index offset indicating which item in the list to return. The index starts at 0
Return Value

Returns a Variant of type String

Remarks

The Receivers collection contains the list of email address that will actually receive the mail message, whereas the Tos and CCs collection contains the list of receivers displayed in the mail message.

Example

In the following example, a receiver is added on the Mail_OnStartRender event

Sub Mail_OnStartRender
Mail.Receivers.Add "TheBoss","bigboss@emilltest.com"
Mail.CCs.Add "TheBoss","bigboss@emilltest.com"
End Sub

Applies To

Mail Object

See Also

Tos, CCs, Collection Object

©2001-2015 eMill . All trademarks property of their owners.


Mail Tos Collection

The Mail.Tos collection contains the list of receivers displayed in the To: field of an email message. The collection can be used to determine the value of a specific To item, or to iterate through the collection and retrieve a list of all To receivers. See the Collection Object for standard collection properties and methods.

Syntax

Item = Mail.Tos(key|index)

Parameters
key
The identifier for the item to return.
index
An index offset indicating which item in the list to return. The index starts at 0
Return Value

Returns a Variant of type String.

Remarks

The Tos collection contains the list of email address that will be displayed in the To: field of an email message, where as the Receivers collection contains the list of receivers that will actually receive the message.

Example

The following example sets the To: field as "<Undisclosed Recipients>"

Sub Mail_OnStartRender
Mail.Tos.RemoveAll
Mail.Tos.Add "<Undisclosed Recipients>"
End Sub

The following example returns all items in Tos collection separated by commas.

Response.Write Mail.Tos

Applies To

Mail Object

See Also

Receivers, CCs, Collection Object

©2001-2015 eMill . All trademarks property of their owners.


Mail CCs Collection

The Mail.CCs collection contains the list of receivers displayed in the CC: field of an email message. The collection can be used to determine the value of a specific CC item, or to iterate through the collection and retrieve a list of all CC items. See the Collection Object for standard collection properties and methods.

Syntax

Item = Mail.CCs(key|index)

Parameters
key
The identifier for the item to return.
index
An index offset indicating which item in the list to return. The index starts at 0
Return Value

Returns a Variant of type String.

Remarks

The CCs collection contains the list of email address that will be displayed in the CC: field of an email message, where as the Receivers collection contains the list of receivers that will actually receive the message.

Example

The following example adds a CC: and a BCC: receiver to the mail message

Sub Mail_OnStartRender
Mail.CCs.Add "ceo@emilltest.com"
Mail.Receivers.Add "ceo@emilltest.com"
Mail.Receivers.Add "spy@emilltest.com"
End Sub

Applies To

Mail Object

See Also

Tos, Receivers, Collection Object

©2001-2015 eMill . All trademarks property of their owners.


Mail Contents Collection

Contents Collection

The Contents collection contains all content files. The collection can be used to determine the value of a specific content item, or to iterate through the collection and retrieve a list of all items in the message.

Syntax

Content = Object.Contents(key|index)

Parameters
key
The name of the content to retrieve.
index
An index offset indicating which item in the list to return. The index starts at 0
Return Value

Returns a Content Object

Examples

In the following example, a specific content is removed on the Mail_OnStartRender event

Sub Mail_OnStartRender
If Record.Fields("Details") = False Then
Mail.Contents.Remove("Details")
End If
End Sub

In the following example, a content is added on the Mail_OnStartRender event

Sub Mail_OnStartRender
Set oContent = Mail.Contents.Add "My new content" 'Add a content named "My new content"
oContent.Data = "Hello this is a test message" 'Add the text data inside of it
oContent.Type = "text/plain" 'Set the content-type
oContent.Headers("X-Body") = 1 'Specify that the content is part of the body
End Sub

Applies To

Mail Object, Mailing Object

See Also

Content Object

©2001-2015 eMill . All trademarks property of their owners.


Mail DSNHeaders Collection

The Mail.DSNHeaders collection contains the list of header fields contained in a DSN message. See the Collection Object for standard collection properties and methods.

Syntax

Item = Mail.DSNHeaders(key|index)

Parameters
key
The identifier for the item to return.
index
An index offset indicating which item in the list to return. The index starts at 0
Return Value

Returns a Variant of type String.

Remarks

The DSNHeaders collection may contain the following field:

Original-Envelope-ID | Contains an "envelope identifier" which uniquely identifies the transaction during which the message was submitted. This fields correspond to what is set using the Mail.DSNEnvID property.
Reporting-MTA | Indicates the MTA which attempted to perform the delivery, relay, or gateway operation described in the DSN. This field is always present.
DSN-Gateway | Indicates the name of the gateway or MTA which translated a foreign (non-Internet) delivery status notification into this DSN
Received-From-MTA | Indicates the name of the MTA from which the message was received.
Arrival-Date | Indicates the date and time at which the message arrived at the Reporting MTA.

See RFC1894 for details about DSN messages.

Example

The following example uses the Original-Envelope-ID to link back to the original receivers database record

Sub Mail_OnReceiveMail
If Mail.DSNHeaders("Original-Envelope-ID") <>
"" Then
sSQL = "SELECT * FROM MyContacts
WHERE ContactID=" & Mail.DSNHeaders("Original-Envelope-ID")
' Execute SQL
query...
' Update
record...
End If
End Sub

Applies To

Mail Object

See Also

DSNReceivers, DSNEnvID, Collection Object

©2001-2015 Active+ Software . All trademarks property of their owners.


Mail DSNReceivers Collection

The Mail.DSNReceivers collection contains the list of header fields contained in a DSN message. See the Collection Object for standard collection properties and methods.

Syntax

Item = Mail.DSNReceivers(key|index)

Parameters
key
The identifier for the item to return.
index
An index offset indicating which item in the list to return. The index starts at 0
Return Value

Returns a Variant of type String.

Remarks

The DSNReceivers collection may contain the following field:

Original-Recipient | Indicates the original recipient address as specified by the sender of the message for which the DSN is being issued. (e.g. "jim@emilltest.com")
X-DB-Original-Recipient | This field is an eMill private field. It will only be available in DSNs generated by the Fax and SMS gateways. It contains the original phone number as it is in the receiver list and can be used to know who was the original recipient of the Fax or the SMS.
Final-Recipient | Indicates the recipient for which this set of per-recipient fields applies. The Final-Recipient address may differ from the address originally provided by the sender, because it may have been transformed during forwarding and gatewaying into an totally unrecognizable mess. (e.g. "jim@server1.mail.emilltest.com")
Action | Indicates the action performed by the Reporting-MTA as a result of its attempt to deliver the message to this recipient address.The action-value may be one of the following: failed, delayed, delivered, relayed, expanded
Status | Contains a transport-independent status code which indicates the delivery status of the message to that recipient. See RFC1893 for details.
Remote-MTA | Contains a printable ASCII representation of the name of the "remote" MTA that reported delivery status to the "reporting" MTA.
Diagnostic-Code | Contains the actual diagnostic code issued by the mail transport
Last-Attempt-Date | Gives the date and time of the last attempt to relay, gateway, or deliver the message (whether successful or unsuccessful) by the Reporting MTA
Will-Retry-Until | Gives the date after which the Reporting MTA expects to abandon all attempts to deliver the message to that recipient.

See RFC1894 for details about DSN messages.

Example

The following example uses the Original-Envelope-ID to link back to the original receivers database record

Sub Mail_OnReceiveMail
If Mail.DSNType<>0 Then
For Each rcv In Mail.DSNReceivers
If Mail.DSNReceivers(rcv)("Original-Recipient") <> "" And LCase(Mail.DSNReceivers(rcv)("Action")) = "failed" Then
aEmail = Split(Mail.DSNReceivers(rcv)("Original-Recipient"), ";") ' Format rfc822;user@domain.com
 sSQL = "SELECT * FROM MyContacts WHERE email='" & Trim(aEmail(1)) & "'"
' Execute SQL query...
' Update record ...
End If
Next
Else
Mailing.MoveReceivedMessage "Sales"
End If
End Sub

Applies To

Mail Object

See Also

DSNHeaders, DSNEnvID, Collection Object

©2001-2015 Active+ Software . All trademarks property of their owners.


Mail Fields Collection

The Mail.Fields collection contains all message body fields. The collection can be used to determine the value of a specific field item, or to iterate through the collection and retrieve a list of all items in the message body. See the Collection Object for standard collection properties and methods.

Syntax

Item = Mail.Fields(key|index)

Parameters
key
The identifier for the item to return.
index
An index offset indicating which item in the list to return. The index starts at 0
Return Value

Returns a variant.

Remarks

The field collection is filled only on incoming message processing, that is, eventually during the Mailing_OnAcceptMail event if the whole message is available, or during the Mailing_OnReceiveMail event.

A body field is composed of a field name, followed by the : or = char, eventually followed by a field value. The body field name is composed of any alphanumeric char, plus the _ . - chars. It can also contains white spaces between other chars. The field value is composed of chars remaining until the end of line or a quoted value (using double quote as quoting char).

Applies To

Mail Object

©2001-2015 eMill . All trademarks property of their owners.


CodePage

The CodePage property specifies how strings are encoded in the intrinsic objects. A code page is a character set that can include numbers, punctuation marks, and other glyphs. Codepages are not the same for each language. Some languages such as Japanese and Korean have multi-byte characters, while others like English and German only need one byte to represent each character. The CodePage property is read/write.

Settings and Return Values

Sets or returns an Integer value.

Remarks

Setting Mail.CodePage explicitly affects the default code page for all content of a mail message.
You can find codepage integers at MSDN Web Workshop under the column for FamilyCodePage.

Applies To

Mail Object

See Also

Mailing.CodePage , Response.CodePage

©2001-2015 eMill . All trademarks property of their owners.


LCID

The LCID property specifies how dates, times, and currencies are formatted. LCIDs are not the same for each geographical locale. Some locales format dates as YY-MM-DD and some format dates as MM-DD-YYYY. The LCID property is read/write.

Settings and Return Values

Sets or returns an Integer value.

Remarks

Setting Mail.LCID explicitly affects all contents of a mail, where Response.LCID affects a single content of a mail message.

Response.LCID can be set multiple times in one content, and the date can be displayed each time; however, the codepage must be set once to show all the characters.

You can find locale integers at MSDN Library.

Applies To

Mail Object

See Also

CodePage, Mailing.LCID, Response.LCID

©2001-2015 eMill . All trademarks property of their owners.


Sender

The Sender property specifies the SMTP sender. The Sender property is a shortcut to the Headers("X-Sender") collection item.

Settings and Return Values

Set or returns a String value.

Remarks

The Sender property must be formatted using the user@domain format. It must not contain any display name such as "Sender Name" <user@domain>
If the Sender property is not set, the Sender property will be initialized using the email part of the From property.

Applies To

Mail Object

See Also

From

©2001-2015 eMill . All trademarks property of their owners.


From

The From property specifies the message From field. The From property is a shortcut to the Headers("From") collection item.

Settings and Return Values

Sets or returns a String value

Remarks

This string must be formatted using the "Sender Name" <user@domain> format.

Applies To

Mail Object

See Also

Sender

©2001-2015 Active+ Software . All trademarks property of their owners.


CodePage

Subject

The Subject property specifies the message subject. The Subject property is a shortcut to the Headers("Subject") collection item.

Settings and Return Values

Sets or returns a String value.

Remarks

If the subject contains special characters, they will be encoded using the current codepage.

Example

In the following example, the subject is customized with the receiver's name and the text is based on the receiver's language.

Sub Mail_OnStartRender
If Record.Field("Country") = "France" Then
Mail.Subject = "Relance à l'attention de " & Record.FullName
Else
Mail.Subject = "Billing reminder to the attention of " & Record.FullName
End If
End Sub

Applies To

Mail Object

©2001-2015 eMill . All trademarks property of their owners.


Date

The Date property specifies the message date and time. The Date property is a shortcut to the Headers("Date") collection item.

Settings and Return Values

Sets or returns a Date value. The date may be a Variant of type Date or String. The string may specify a classic date/time format or an rfc822 date/time format. If the time is specified but not the date, the date will be set with the current system date.

Remarks

When a new mail is created, the date property is initialized using the current system date. The time zone used is the system time zone.

Applies To

Mail Object

©2001-2015 eMill . All trademarks property of their owners.


Mail Priority

Priority

The Priority property specifies the message priority. The Priority property is a shortcut to the Headers("X-Priority") collection item.

Settings and Return Values

Sets or returns an Integer value.

Remarks

By default, the optional Priority filled is not set.
Set 1 for very high priority, 3 for normal priority and 5 for very low priority.

Applies To

Mail Object

©2001-2015 eMill . All trademarks property of their owners.


Mail DSNEnvID

DSNEnvID

The DSNEnvID property specifies the message envelope ID as defined in RFC1891.

Settings and Return Values

Sets or returns a String value.

Remarks

The String may contain up to 100 characters (any ASCII characters between "!" (33) and "~" (126), except for "+" and "=")

DSN stands for "Delivery Status Notifications", it is an ESMTP extension that is implemented by most modern SMTP servers. See RFC1891 for details.

Examples

Sub Mail_OnStartRender()
' Save the database contact ID in the ESMTP DSN Envelope-ID to
' update the database later using the DSN message
Mail.DSNEnvID = Record.Fields("ContactID")
Mail.DSNNotify = "SUCCESS,FAILURE"
End Sub

Applies To

Mail Object

©2001-2015 Active+ Software . All trademarks property of their owners.


Mail DSNReturn

DSNReturn

The DSNReturn property specifies whether or not the message should be included in any failed DSN issued for this message transmission.

Settings and Return Values

Sets or returns a String value.

Remarks

The DSNReturn property may be set with on of the following keyword:

FULL requests that the entire message be returned in any "failed"
delivery status notification issued for this recipient.

HDRS requests that only the headers of the message be returned.

The FULL and HDRS keywords may be spelled in any combination of upper
and lower case letters.

DSN stands for "Delivery Status Notifications", it is an ESMTP extension that is implemented by most modern SMTP servers. See RFC1891 for details.

Applies To

Mail Object

©2001-2015 Active+ Software . All trademarks property of their owners.


Mail DSNNotify

DSNNotify

The DSNNotify property specifies whether or not the message should be included in any failed DSN issued for this message transmission.

Settings and Return Values

Sets or returns a String value.

Remarks

The DSNNotify property may be set with on of the following keywords:

NEVER requests that a DSN not be returned to the sender under any conditions
SUCCESS requests that a DSN be issued on successful delivery.
FAILURE requests that a DSN be issued on delivery failure.
DELAY requests that a DSN be issued if the message has been delayed for an unusual amount
of time.

Multiple keywords, separated by commas, may be set; however, the NEVER keyword MUST appear by itself.

DSN stands for "Delivery Status Notifications", it is an ESMTP extension that is implemented by most modern mail servers. See RFC1891 for details.

Applies To

Mail Object

©2001-2015 Active+ Software . All trademarks property of their owners.


Mail DSNType

DSNType

The DSNType property returns whether or not the message is a DSN.

Return Values

Returns an Integer value.

Remarks

The DSNType property may return on of the following values:

0 The message is not a DSN
1 The message is a standard DSN (see RFC1894 for details)
2 The message is a simulated DSN constructed from a non standard failure notification message.

Whenever possible, eMill will try to simulate a DSN message based on various format that older mail server sends out.

DSN stands for "Delivery Status Notifications", it is an ESMTP extension that is implemented by most modern mail servers. See RFC1891 and RFC1894 for details.

Example

Sub Mailing_OnReceiveMail
 If Mail.DSNType<>0 Then ' Remove delivery status notifications messages
Mailing.RemoveReceivedMail
Else ' Forward to sales department
Mail.Receivers.RemoveAll
Mail.Receivers.Add "sales@emilltest.com"
Mailing.SubmitMail Mail
End If
End Sub

Applies To

Mail Object

©2001-2015 Active+ Software . All trademarks property of their owners.


AbortRender

The AbortRender method will abort the rendering process for the current mail.

Syntax

Mail.AbortRender

Parameters
None
Example

Mail_OnStartRender
...
If bSomeFailure Then
Mail.AbortRender
End If
End Sub

Applies To

Mail Object

See Also

Mailing.AbortRender

©2001-2015 eMill . All trademarks property of their owners.


Mail_OnEndRender

The Mail_OnEndRender event occurs when rendering ends for the current receiver.

Syntax

Sub Mail_OnEndRender
. . .
End Sub

Parameters
None
Applies To

Mail Object

See Also

Mail_OnStartRender

©2001-2015 eMill . All trademarks property of their owners.


Mail_OnStartRender

The Mail_OnStartRender event occurs when rendering starts for a mailing receiver. The Mail_OnStartRender event is a good time for you to set any receiver-wide variables, because they will be set before any contents are rendered.

Syntax

Sub Mail_OnStartRender
. . .
End Sub

Parameters
None
Example

Sub Mail_OnStartRender()
' Sets a X-Subscriber-ID: header field
to trace the subscriber if the mail fails
Mail.Headers("X-Subscriber-ID") =
Record.Fields("ContactID")
' Sets that today's subject
Mail.Subject = FormatDateTime(Date,2) & ":
Today's F1 racing news"
' Remove non necessary mail contents
If Record.Fields("PreferredFormat") = "PDF"
Then
Mail.Contents.Remove("HtmlNews")
Mail.Contents.Remove("TextNews")
Else If Record.Fields("PreferredFormat") =
"HTML" Then
Mail.Contents.Remove("PDFNews")
Mail.Contents.Remove("TextNews")
Else ' The subscriber wants a text based email
Mail.Contents.Remove("PDFNews")
Mail.Contents.Remove("HtmlNews")
End If
End Sub
Remarks

Receivers set in the Record object as well as predefined content files will be added before Mail_OnStartRender is called.

Applies To

Mail Object

See Also

Mail_OnEndRender, Mailing_OnStartRender

©2001-2015 eMill . All trademarks property of their owners.


Content Object

You can use the Content object to access information about a Mail content.

Syntax

Content.collection|property|method

Collections
Headers Contains the list of headers field.
Properties
CID | Gets or Sets the MIME content ID.
Data | Gets or Sets the content data.
Type | Gets or Sets the MIME content type.
TransferEncoding | Gets or Sets the MIME transfer encoding.
URL | Gets or Sets the content URL.

Additional content header fields can be set using the Headers collection

Methods
CreateCID | This method will create a unique content identifier
Save | Saves the content to the disk.
See Also

Contents Collection

©2001-2015 eMill . All trademarks property of their owners.


Content Headers Collection

The Content.Headers collection contains all message part headers. The collection can be used to determine the value of a specific header item, or to iterate through the collection and retrieve a list of all items in the message part header. See the Collection Object for standard collection properties and methods.

Syntax

Content.Headers(key|index)[(subkey)]

Parameters
key
The identifier for the item to return.
index
An index offset indicating which item in the list to return. The index starts at 0
subkey
The identifier for the sub item to return. An empty string will return the primary item.
Remarks

The key should not contain the column character ':'
eMill implements the following internal header fields (these fields will never appear in the MIME encoded mail) :
X-Enabled: Set to 1 if the content should be included in the final rendered message, set to 0 otherwise.
X-Body: Set to 1 if the content is the body part of the message. This property only applies to text/plain and text/html contents. A body part is the part that is first displayed when a message is opened.
X-PDF: Set to 1 if the content should be converted to the Acrobat PDF format. Only text/plain and text/html contents can be converted to PDF.
X-ZIP: Set to 1 if the content should be converted to the ZIP format.
X-Render: Set to 1 if the source contains script to be executed. The script should be within <% and %> delimiters.
X-Wrap-Text: Set to n (76 is the recommended value) to limit the number of characters per line in a text/plain content.
X-Href-Prefix: Specify a prefix to set on all http:// urls in a text/html content. Can be used to implement a URL tracking system.
X-Href-Suffix: Specify a suffix to set on all http:// urls in a text/html content. Can be used to implement a URL tracking system.
X-Embed-Images: Set to 1 if the images referenced in the HTML content should be embedded within the message, set to 0 otherwise.
X-Tracking: Set to 3 to enable openings and clicks tracking, set to 2 to enable clicks tracking, set to 1 to enable openings tracking or set to 0 to disable tracking for this content.
X-Disable-Merge-Fields: Set to 1 to disable merge fields replacement for text contents.

The X-PDF and X-ZIP header fields support a "filename" subkey that can be used to specify the resulting file name. The X-ZIP field support a "password" subkey that can be used to password protect the resulting zip file.

Example

In the following example, a customized Content-Disposition header field is set on the Mail_OnStartRender event

Sub Mail_OnStartRender
With Mail.Contents("Invoice")
.Headers("Content-Disposition") = "attachment"
.Headers("X-PDF") = "1" ' The html invoice will be converted to PDF (Content-Type: application/pdf)
.Headers("X-PDF")("filename") = "Invoice.pdf" ' Optional attribute to specify the PDF filename
End With
End Sub

In the following example, we read the charset from the content type using a subkey

If the "Content-Type" contains: "text/html; charset=iso-8859-1"
Mail.Contents("NewsLetter").Headers("Content-Type")("charset")
    ' Returns iso-8859-1
Mail.Contents("NewsLetter").Headers("Content-Type")("")
    ' Returns text/html
Mail.Contents("NewsLetter").Headers("Content-Type") '
    Returns text/html; charset=iso-8859-1

Applies To

Content Object

©2001-2015 eMill. All trademarks property of their owners.


CID

The CID property sets or gets the content identifier.

Settings and Return Values

Sets or returns a String value.

Remarks

A CID should only be set if the content is referenced in a URI of a text/html content type.

Example

Code in the Mail_OnStartRender handler:

Mail.Contents.Add("chart")
Mail.Contents("chart").URL = "http://www.emilltest.com/chartapp/renderpie.asp?v1=12&v2=38&v3=50"
Mail.Contents("chart").CreateCID

Some content:

<body>
See the following pie chart: <img src=<%="CID:" & Mail.Contents("chart").CID%>>
</body>

Applies To

Content Object

See Also

Contents Collection

©2001-2015 eMill . All trademarks property of their owners.


Data

The Data property sets or gets the content data.

Settings and Return Values

Sets or returns a Variant of subtype String if the Content Type is text based (text/*) or a Variant of subtype Array of Byte if the data is binary.

Remarks

The Data property cannot be set if the URL property is set.

Example

Mail.Contents("Body").Type = "text/html"
Mail.Contents("Body").Data = "Hello<BR>What's the weather like today?<BR>Regards,<BR>John<BR>"
Mail.Contents("Body").TransferEncoding = "quoted-printable"

Applies To

Content Object

See Also

URL, Type, TransferEncoding

©2001-2015 eMill . All trademarks property of their owners.


Type

The Type property sets or gets the MIME content type and sub type.

Settings and Return Values

Sets or returns a String value.

Remarks

Click here to see a list of MIME Content Types

Applies To

Content Object

See Also

TransferEncoding

©2001-2015 eMill . All trademarks property of their owners.


TransferEncoding

The TransferEncoding property sets or gets the MIME transfer encoding.

Settings and Return Values

Sets or returns a String value.

Remarks

eMill supports the following transfer encoding:
base64
quoted-printable
8bit
7bit

base64 encoding will work with any kind Content Type
quoted-printable, 8bit and 7bit should be used with text/ based contents

Setting the property to Auto will instruct eMill to compute the best possible encoding for the content.

Applies To

Content Object

See Also

Type

©2001-2015 eMill . All trademarks property of their owners.


URL

The URL property sets or gets the content path. The URL property is the default Content Object property.

Settings and Return Values

Sets or returns a String value.

Remarks

The path can be absolute or relative to the project root path, and can specify any types of files including Unicode text files.
Parameters can be passed to any script enabled content file using a question mark. E.g. file.vbs?id=12345678
The Server.URLEncode method can be used to encode parameters (parameters with spaces, etc.).
If the path is set to an http URL, the Content object will dynamically fetch the data from a web server.

Examples

Mail.Contents("News") = "c:\newsletter\20010601.html"
Mail.Contents("News").TransferEncoding = "base64"

Mail.Contents("PieChart") = "http://www.emilltest.com/chartapp/renderpie.asp?v1=12&v2=38&v3=50"
Mail.Contents("PieChart").TransferEncoding = "base64"

Applies To

Content Object

See Also

Contents Collection, Request.QueryString , Server.URLEncode

©2001-2015 eMill . All trademarks property of their owners.


CreateCID

The CreateCID method will create and set a unique content identifier.

Syntax

Content.CreateCID

Parameters
None
Remarks

If a CID is already set in the content, the CID will be replaced with the new CID.

Applies To

Content Object

See Also

CID

©2001-2015 eMill . All trademarks property of their owners.


Save

The Save method will create and set a unique content identifier.

Syntax

Content.Save(FileName)

Parameters
FileName
A String specifying the new filename for the content to be saved.
Remarks

If the file already exists, the file will be overwritten.

Applies To

Content Object

See Also

Mail.Save

©2001-2015 eMill . All trademarks property of their owners.


Record Object

You can use the Record object at render time to access the current DataSource record fields.

Syntax

Record.collection|property|method

Collections
Fields Contains the list of field if the record
Properties
SentenceCase | Sets or Gets how the receiver name should be formatted.
Trim | Sets or Gets how record fields are trimmed.
EmailAddress | Gets the displayable email address.
Email | Gets the email address.
FullName | Gets the full name.
FirstName | Gets the first name.
LastName | Gets the last name.
Fax | Gets the fax number.
Mobile | Gets the mobile phone number.
Remarks

The Record field is initialized by the DataSource object. Calculated Properties (EmailAddress, Email, FullName, etc.) will be automatically set before Mail_OnStartRender gets called.

Example

<html>
Dear <%=Record.FirstName%><br>
I was wondering about what the weather's like in <%=Record.Fields("City")%>?<br>
Regards,<br>
<%=Record.Fields("AccountManager")%>
</html>

See Also

DataSource Object

©2001-2015 eMill . All trademarks property of their owners.


Record Fields Collection

The Fields collection contains all record fields for the current receiver.

Syntax

Item = Record.Fields(key|index)

Parameters
key
The identifier for the item to return.
index
An index offset indicating which item in the list to return. The index starts at 0
Field object properties
Name | Gets or sets the record field name.
Value | Gets or sets the record field value. This is the default property.
Type | Gets or sets the record field ADO type.
DefinedSize | Gets or sets the record field size.
Attributes | Gets or sets the record field ADO attributes.
Changed | Gets or sets the record field Changed value. When the record value is modified, Changed is automatically set to TRUE.
BaseTable | Gets or sets the record field base table. Can be empty if the field does not come from a database column.
BaseColum | Gets or sets the record field base column. Can be empty if the field does not come from a database column.
Remarks

Field properties are automatically set by eMill during the rendering process. However, when using Global Script to access data source, it is up to the global script to fill these properties.

See the Collection Object for standard collection properties and methods.

Examples

The following example will list all the fields in a record

For Each item In Record.Fields
sFieldName = item.Name
sFieldValue = item.Value
Next

The following example gets a specific field value

sFieldValue = Record.Fields("ZipCode")

Applies To

Record Object

See Also

DataSource Object

©2001-2015 eMill . All trademarks property of their owners.


Record.SentenceCase

SentenceCase

The SentenceCase property specifies how the receiver name is formatted.

Settings and Return Values

Sets or returns a Boolean Value.

Remarks

Set to True to have the first letter of each word in upper case and the following letters in lowercase, set to False to leave unchanged.

Examples

In the following examples the SentenceCase property is to True

Record: FullName="jim smith"
Result: "Jim Smith"

Record: FullName="jean-baptiste DURAND"
Result: "Jean-Baptiste Durand"

Applies To

Record Object

©2001-2015 eMill . All trademarks property of their owners.


Record.EmailAddress

EmailAddress

The EmailAddress property returns a displayable email address.

Return Value
Returns a String value.
Examples

Record: Email="jim@emilltest.com" FirstName="Jim" LastName="Smith"
Result: "Jim Smith" <jim@emilltest.com>

Record: Email="jim@emilltest.com" FirstName="" LastName=""
Result: jim@emilltest.com

Applies To

Record Object

See Also

Email

©2001-2015 eMill . All trademarks property of their owners.


Record.Email

Email

The Email property returns the email part of an email address.

Syntax

=Record.Email

Return Value
A String that specify an email address
Examples

Record: Email='<jim@emilltest.com>'
Result: jim@emilltest.com

Record: Email='"Jim Smith" <jim@emilltest.com>'
Result: jim@emilltest.com

Record: Email='mailto:jim@emilltest.com'
Result: jim@emilltest.com

Applies To

Record Object

See Also

EmailAddress

©2001-2015 eMill . All trademarks property of their owners.


Record.FullName

FullName

The FullName property returns the receiver full name.

Return Value
Returns a String value.
Applies To

Record Object

©2001-2015 eMill . All trademarks property of their owners.


Record.FirstName

FirstName

The FirstName property returns the receiver first name.

Return Value
Returns a String value.
Applies To

Record Object

©2001-2015 eMill . All trademarks property of their owners.


Record.LastName

LastName

The LastName property returns the receiver first name.

Return Value
Returns a String value.
Applies To

Record Object

©2001-2015 eMill . All trademarks property of their owners.


Application Object

You can use the Application object to share information among all session of a given mailing project.

Syntax

Application.collection

Collections
Contents Contains all of the items that have been added to the application through script commands.
Remarks

You can store values in the Application Collections. Information stored in the Application collections is available throughout the mailing session.

Example
Sub Mailing_OnStartRender
  Application("ReceiverCount") = 0
End Sub
Sub Mail_OnStartRender
  Application("ReceiverCount") = Application("ReceiverCount") + 1
End Sub
' Some content
<%
  Response.Write "Receiver # " & Application("ReceiverCount") & "<br>"
%>
See Also

Session Object

©2001-2015 eMill . All trademarks property of their owners.


Application Contents Collection

The Contents collection contains all the items that have been added to the application through a script command. Information stored in the Application collections is available throughout the mailing session. You can use the Contents collection to obtain a list of items that have been given application scope, or to specify a particular item to be the target of an operation. See the Collection Object for standard collection properties and methods.

Syntax

Item = Application.Contents(key|index)

Parameters
key
The identifier for the item to return.
index
An index offset indicating which item in the list to return. The index starts at 0
Settings and Return Values

Sets or returns a Variant value.

Remarks

The Contents collection is the Application object implicit collection. Therefore you do not need to specify .Contents when accessing the collection.

Example

Application("SomeValue") = "13456789"

Applies To

Application Object

See Also

Session Contents Collection

©2001-2015 eMill . All trademarks property of their owners.


Request Object

The Request object retrieves the values that the client browser passed to the server during an HTTP request.

Syntax

Request[.collection|property|method](variable)

Collections
QueryString | The values of variables in the HTTP query string.
ServerVariables | The values of predetermined environment variables.

Variable parameters are strings that specify the item to be retrieved from a collection or to be used as input for a method or property. For more information about the variable parameter, see the individual collection descriptions.

Remarks

If the specified variable is not in one of the preceding five collections, the Request object returns EMPTY.

All variables can be accessed directly by calling Request(variable) without the collection name. In this case, eMill searches the collections in the following order.

  1. QueryString
  2. ServerVariables

If a variable with the same name exists in more than one collection, the Request object returns the first instance that the object encounters.

It is strongly recommended that when referring to members of a collection the full name is used. For example, rather than Request.(SERVER_NAME) use Request.ServerVariables(SERVER_NAME). This will allow the server to locate the item more quickly.

See Also

Response Object

©2001-2015 eMill . All trademarks property of their owners.


QueryString

The QueryString collection retrieves the values of the variables in the content query string. The content query string is specified by the values following the question mark (?). Several different processes can generate a query string. For example, the anchor tag

<A HREF= "invoice.vbs?id=12345678">Click here to open your invoice</A>

generates a variable named id with the value "12345678"

Syntax

Request.QueryString(variable)[(index)|.Count]

Parameters
variable
Specifies the name of the variable in the content query string to retrieve.
index
An optional parameter that enables you to retrieve one of multiple values for variable. It can be any integer value in the range 1 to Request.QueryString(variable).Count.
Remarks

The QueryString collection is a parsed version of the QUERY_STRING variable in the ServerVariables collection. It enables you to retrieve the QUERY_STRING variable by name. The value of Request.QueryString(parameter) is an array of all of the values of parameter that occur in QUERY_STRING. You can determine the number of values of a parameter by calling Request.QueryString(parameter).Count. If a variable does not have multiple data sets associated with it, the count is 1. If the variable is not found, the count is 0.

To reference a QueryString variable in one of multiple data sets, you specify a value for index. The index parameter can be any value between 1 and Request.QueryString(variable).Count. If you reference one of multiple QueryString variables without specifying a value for index, the data is returned as a comma-delimited string.

When you use parameters with Request.QueryString, the server parses the parameters sent to the request and returns the specified data. If your application requires unparsed QueryString data, you can retrieve it by calling Request.QueryString without any parameters.

Example

The mail body links to the invoice content

invoice.vbs?id=12345678
results in the following Request.QueryString("id") value:
12345678

If the following script is used:

The unparsed query string is: <%=Request.QueryString%>
The output would be
The unparsed query string is: id=12345678
Applies To

Request Object

See Also

ServerVariables

©2001-2015 eMill . All trademarks property of their owners.


ServerVariables

The ServerVariables collection retrieves the values of predetermined server environment variables.

Syntax

Request.ServerVariables (server environment variable)

Parameters
server environment variable
Specifies the name of the server environment variable to retrieve. It can be one of the following values.
Variable | Description
APPL_PHYSICAL_PATH | Retrieves the physical path corresponding to the metabase path. IIS converts the APPL_MD_PATH to the physical (directory) path to return this value.
PROJECT_PATH | Returns the path to the published project.
CONTENT_NAME | Returns the name of the current content.
HIT_DATE | [Tracking only] Return the date of the click or open event.
HTTP_REFERER | [Tracking only] Returns a string containing the URL of the page that referred the request to the redirector.
HTTP_USER_AGENT | [Tracking only] Returns a string describing the client mail software that sent the request.
LOGON_USER | The Windows account that the user is logged into.
PATH_INFO | Extra path information as given by the client. You can access scripts by using their virtual path and the PATH_INFO server variable. If this information comes from a URL, it is decoded by the server before it is passed to the CGI script.
PATH_TRANSLATED | A translated version of PATH_INFO that takes the path and performs any necessary virtual-to-physical mapping.
QUERY_STRING | Query information stored in the string following the question mark (?) in the HTTP request.
REMOTE_ADDR | [Tracking only] Returns the IP address of the receiver who as clicked on the link.
SCRIPT_NAME | Gives the base portion of the script being executed.
SERVER_NAME | The server's host name, DNS alias, or IP address as it would appear in self-referencing URLs.
SERVER_SOFTWARE | The name and version of the server software that answers the request and runs the gateway. The format is name/version.
URL Gives the base portion of the URL.
[Tracking] Returns a string containing either open when a message is open or the link URL when a link is clicked.
URL_NAME | Gives the name of the link that has been clicked, or an empty string if the link does not have a name.

Example

This example uses the For Each loop to iterate through each existing server variable name. Some will be empty if you have Anonymous Access enabled. The following script prints out all of the server variables in a table:

<TABLE BORDER="1">
<TR><TD><B>Server Variable</B></TD><TD><B>Value</B></TD></TR>
<% For Each strKey In Request.ServerVariables %>
<TR>
<TD><%= strKey %></TD>
<TD><%= Request.ServerVariables(strKey) %></TD>
</TR>
<% Next %>
</TABLE>
Applies To

Request Object

See Also

QueryString

©2001-2015 eMill . All trademarks property of their owners.


Response Object

You can use the Response object to send output to the rendered content.

Syntax

Response.collection|property|method

Properties
Charset | Sets the MIME part charset header. The character set tells the mail client how to display characters.
CodePage | Sets the Codepage for data in the intrinsic objects for one response. The codepage tells eMill how to encode characters for different languages.
ContentType | Specifies the MIME part content type for the response.
LCID | Sets the LCID for data for one response. The LCID refers to how dates, times, and currency are formatted for a specific geographical locale.
Methods
AddHeader | Adds MIME part header name to value.
BinaryWrite | Writes the given information to the current content output without any character-set conversion.
Clear | Erases any buffered content output.
End | Stops processing the content file and returns the current result.
Flush | Sends buffered output immediately.
Write | Writes a variable or text to the current content output as a string.
See Also

Request Object

©2001-2015 eMill . All trademarks property of their owners.


Charset

The Charset property appends the name of the character set (for example, ISO-LATIN-7) to the Content-Type header in the response object. Setting the CodePage will automatically set the Charset. To specify a specific charset, the Charset property should be set after the CodePage property.

Settings and Return Values

Sets or returns a String value.

Remarks

This function sets any string in the MIME part header, regardless of whether it represents a valid character set or not.

Applies To

Response Object

See Also

CodePage

©2001-2015 eMill . All trademarks property of their owners.


CodePage

The CodePage property specifies how strings are encoded in the intrinsic objects. A code page is a character set that can include numbers, punctuation marks, and other glyphs. Codepages are not the same for each language. Some languages such as Japanese and Korean have multi-byte characters, while others like English and German only need one byte to represent each character. The CodePage property is read/write.

Settings and Return Values

Sets or returns an Integer value.

Remarks

Setting Response.CodePage explicitly affects the current content, where Mail.CodePage affects all content of a mail message.
Settings the CodePage will automatically set the corresponding Charset, however the Charset can be specifically specified if needed.
You can find codepage values at MSDN Web Workshop under the column for FamilyCodePage.

Applies To

Response Object

See Also

Charset , Mail.CodePage, Mailing.CodePage

©2001-2015 eMill . All trademarks property of their owners.


ContentType

The ContentType property specifies the HTTP content type for the response. If no ContentType is specified, the default comes from the content which is rendering.

Settings and Return Values

Sets or returns a String value.

Remarks

The ContentType string is usually formatted type/subtype where type is the general content category and subtype is the specific content type. For a full list of supported content types, see your Web browser documentation or the current HTTP specification.

Example

The following example sets the content type to JPEG image.

<% Response.ContentType = "image/jpeg" %>

The following examples set the ContentType property to other common values.

<% Response.ContentType = "text/html" %>
<% Response.ContentType = "image/GIF" %>
<% Response.ContentType = "text/plain" %>
Applies To

Response Object

©2001-2015 eMill . All trademarks property of their owners.


LCID

The LCID property specifies how dates, times, and currencies are formatted. LCIDs are not the same for each geographical locale. Some locales format dates as YY-MM-DD and some format dates as MM-DD-YYYY. The LCID property is read/write.

Settings and Return Values

Sets or returns an Integer value.

Remarks

Setting Response.LCID explicitly affects the current content, where Mail.LCID affects all contents of a mail message.

Response.LCID can be set multiple times in one content, and the date can be displayed each time; however, the codepage must be set once to show all the characters.

You can find locale integers at MSDN Library.

Example

The following example displays. The home page is saved in UTF-8 format so characters from all languages can be shown.

--- Content_Response_LCID.vbs ---

Response.Codepage = 65001
Response.Charset = "utf-8"

ShowDateTimeCurrency 1033, "North America"
ShowDateTimeCurrency 1041, "Japan"
ShowDateTimeCurrency 1049, "Russia"
ShowDateTimeCurrency 1031, "Germany"
ShowDateTimeCurrency 1025, "Saudi Arabia"
ShowDateTimeCurrency 1081, "India"
ShowDateTimeCurrency 2052, "China"
ShowDateTimeCurrency 1042, "Korea"

Sub ShowDateTimeCurrency(iLCID, sLocale)
  Response.LCID = iLCID
  Response.Write "<B>" & sLocale & "</B><BR>"
  Response.Write FormatDateTime(Date, 1) & "<BR>"
  Response.Write FormatDateTime(Time, 3) & "<BR>"
  Response.Write FormatCurrency(1000) & "<BR>"
  Response.Write FormatNumber(50, 3, 0, 0, -1) & " & " & FormatNumber(.02, 3, 0, 0, -1) & "<BR><BR>"
End Sub
Applies To

Response Object

See Also

CodePage , Charset

©2001-2015 eMill . All trademarks property of their owners.


AddHeader

The AddHeader method adds a new MIME header and value to the rendered content. It does not replace an existing header of the same name. Once a header has been added, it cannot be removed.

Syntax

Response.AddHeader name, value

Parameters
name
A string that indicates the name of the new header.
value
A string that indicates the initial value of the new header.
Example

You can use AddHeader to embed some internal data that may be needed at a later time (mail forwarding, etc.)

<% Response.Addheader "X-Invoice-ID", "12345678" %>
Applies To

Response Object

©2001-2015 eMill . All trademarks property of their owners.


BinaryWrite

The BinaryWrite method writes the specified information to the current content output without any character conversion. This method is useful for writing non-string information such as binary data required by a custom application.

Syntax

Response.BinaryWrite data

Parameters
data
The data to write to the content output. This parameter will be of type VT_ARRAY | VT_UI1, which is a variant array of unsigned one-byte characters.
Example

If you have an object that generates an array of bytes, you can use the following call to BinaryWrite to send the bytes to a custom application.

<%
  Set objBinaryGen = Server.CreateObject("ChartGenerator.Pie")
  vntPicture = objBinaryGen.MakeChart
  Response.ContentType = "image/gif"
  Response.BinaryWrite vntPicture
%>
Applies To

Response Object

See Also

Write

©2001-2015 eMill . All trademarks property of their owners.


Clear

The Clear method erases any buffered output. However, the Clear method erases only the response body; it does not erase response headers. You can use this method to handle error cases.

Syntax

Response.Clear

Applies To

Response Object

See Also

End, Flush

©2001-2015 eMill . All trademarks property of their owners.


End

The End method causes eMill to stop processing the script and return the current result. The remaining contents of the file are not processed.

Syntax

Response.End

Applies To

Response Object

See Also

Clear, Mail.AbortRender

©2001-2015 eMill . All trademarks property of their owners.


Flush

The Flush method sends buffered output immediately to the disk.

Syntax

Response.Flush

Applies To

Response Object

©2001-2015 eMill . All trademarks property of their owners.


Write

The Write method writes a specified string to the current content output.

Syntax

Response.Write variant

Parameters
variant
The data to write. This parameter can be any data type supported by the Visual Basic Scripting Edition VARIANT data type, including characters, strings, and integers.
Notes

If you do not want to use the default language codepage, output from Response.Write can be encoded using different codepages by setting Response.CodePage, Session.CodePage. For more information, see CodePage and Charset.

Example

The following example uses the Response.Write method and plain HTML to send output to the client.

<H3 align=center>The date is <% Response.Write Date %> <BR>

The following example uses <%= instead of Response.Write.

The date is: <%= Date %> <BR>

The following example adds an HTML tag to the Web page output. Because the string returned by the Write method cannot contain the character combination %>, the escape %\> has been used instead. The following script

<% Response.Write "<TABLE WIDTH = 100%\>" %>

Produces the output:

<TABLE WIDTH = 100%>
Applies To

Response Object

See Also

BinaryWrite, Charset, CodePage.

©2001-2015 eMill . All trademarks property of their owners.


Server Object

The Server object provides access to methods and properties on the server. Most of these methods and properties serve as utility functions.

Syntax

Server.property|method

Properties
ScriptTimeout The amount of time that a script can run before it times out.
Methods
CreateObject | Creates an instance of a server component.
Execute | Executes an .asp file.
HTMLEncode | Applies HTML encoding to the specified string.
MapPath | Maps the specified virtual path, either the absolute path on the current server or the path relative to the current page, into a physical path.
Transfer | Sends all of the current state information to another script enabled file for processing.
URLEncode | Applies URL encoding rules, including escape characters, to the string.

©2001-2015 eMill . All trademarks property of their owners.


ScriptTimeout

The ScriptTimeout property specifies the maximum amount of seconds a script can run before it is terminated.

The timeout will not take effect while a server component is processing.

Settings and Return Values

Sets or returns an Integer value.

Remarks
Specifies the maximum number of seconds that a script can run before the server terminates it. The default value is 90 seconds.
Example

The following example causes scripts to time out if the server takes longer than 100 seconds to process them:

<% Server.ScriptTimeout = 100 %>

The following example retrieves the current value of the ScriptTimeout property and stores it in the variable TimeOut.

<% TimeOut = Server.ScriptTimeout %>
Applies To

Server Object

©2001-2015 eMill . All trademarks property of their owners.


CreateObject

The CreateObject method creates an instance of a server component.

Syntax

Server.CreateObject( progID )

Parameters
progID
Specifies the type of object to create. The format for progID is [Vendor.]Component[.Version].
Remarks

By default, objects created by the Server.CreateObject method have content file scope. This means that they are automatically destroyed by the server when it finishes processing the current content file.

Example
<% Set MyChart = Server.CreateObject("SuperChart.Pie") %>

The preceding example creates a server component, MyChart, as a SuperChart.Pie component that can be used to render a pie chart within an html content.

Applies To

Server Object

©2001-2015 eMill . All trademarks property of their owners.


Execute

The Execute method calls a script enabled content file and processes it as if it were part of the calling script. The Execute method is similar to a procedure call in many programming languages.

Syntax

Server.Execute( Path )

Parameters
Path
A string specifying the location of a script enabled content file to execute. The Path parameter may be for either an absolute or a relative path.
Remarks

The Server.Execute method provides a way of dividing a complex application into individual modules. By employing the Server.Execute method, you can develop a library of .vbs files that you can call as needed. This approach is an alternative to server-side includes. The major difference is that you can dynamically call a script enabled file with Server.Execute.

After eMill processes the script enabled content file specified in the input parameter to Server.Execute, the response is returned to the calling script.

Collections and properties available to the executed file are:

  • Application variables, even if they are set in the calling page.
  • Session properties, even if they are set in the calling page.
  • Server variables and properties, even if they are set in the calling page.
  • Request collections and properties, even if they are set in the calling page. This includes Form and QueryString data passed to the calling page.
  • Response collections and properties. The executed .asp file may modify HTTP headers. However, as with any .asp file, if the executed .asp file attempts to modify HTTP headers after it sends a response to the client, it will generate an error.

If a file is included in the calling page with #include, the executed .asp will not see it. For example, you may have a subroutine in a file that is included in your calling page, but the executed .asp will not recognize the subroutine name. You must include the file in each executed .asp that requires the subroutine.

If either the calling or called .asp file contains a transaction directive, the status of the transaction will apply to the .asp file that contains the directive. For example, if ASP1 below calls ASP2 and the transaction is aborted while ASP2 is being processed, ASP2's OnTransactionAbort (if present) will be called. After ASP2 completes processing, ASP1's OnTransactionAbort (if present) will be called.

ASP1:
<%@ Transaction=Required %>
<%
  Server.Execute ("ASP2.asp")
  Sub OnTransactionAbort
  Sub OnTransactionCommit
%>

ASP2.asp:
<%@ Transaction=Required %>
<%
  Sub OnTransactionAbort
  Sub OnTransactionCommit
%>
Example

In the following example, the browser language determines which .asp file is executed. The output from these scripts on a US system is:

Company Name

Welcome to my website!

The output from these scripts on a German system is:

Company Name

Willkommen zu meinem website!

The output from these scripts on a Spanish system is:

Company Name

Recepción a mi website!

(Languages with multi-byte characters have not been included in this example because CodePage incompatibilities.)

Welcome.asp

<HTML>
<BODY>
<H1>Company Name</H1>
<%
  AcceptLang = Request.ServerVariables("HTTP_ACCEPT_LANGUAGE")
  Lang = Left(AcceptLang, 2)
  Server.Execute(Lang & "Welcome.asp")
%>
</BODY>
</HTML>

enWelcome.asp

<% Response.Write "Welcome to my website!" %>

deWelcome.asp

<% Response.Write "Willkommen zu meinem website!" %>

esWelcome.asp

<% Response.Write "Recepción a mi website!" %>
Applies to

Server Object

See Also

Transfer

©2001-2015 eMill . All trademarks property of their owners.


HTMLEncode

The HTMLEncode method applies HTML encoding to a specified string.

Syntax

Server.HTMLEncode( string )

Parameters
string
Specifies the string to encode.
Example

The following script

<%= Server.HTMLEncode("The bold tag: <B>") %>

Produces the output:

The bold tag: &lt;B&gt;
Applies To

Server Object

See Also

URLEncode

©2001-2015 eMill . All trademarks property of their owners.


MapPath

The MapPath method maps the specified relative path to the corresponding physical directory on the server.

Syntax

Server.MapPath( Path )

Parameters
Path
Specifies the relative path to map to a physical directory. If Path starts with either a forward (/) or backward slash (\), the MapPath method returns a path as if Path is a full path. If Path doesn't start with a slash, the MapPath method returns a path relative to the directory of the content file being processed.
Remarks

The MapPath method does not check whether the path it returns is valid or exists on the server.

Because the MapPath method maps a path regardless of whether the specified directories currently exist, you can use the MapPath method to map a path to a physical directory structure, and then pass that path to a component that creates the specified directory or file on the server.

Example

For the examples below, the file data.txt is located in the directory, C:\Inetpub\Wwwroot\Script, as is the test.asp file that contains the following scripts. The C:\Inetpub\Wwwroot directory is set as the server's home directory.

The following example uses the server variable PATH_INFO to map the physical path of the current file.

<%= Server.MapPath(Request.ServerVariables("PATH_INFO"))%><BR>

The preceding script produces the output

c:\inetpub\wwwroot\script\test.asp<BR>

Because the path parameters in the following examples do not start with a slash character, they are mapped relative to the current directory, in this case C:\Inetpub\Wwwroot\Script.

<%= Server.MapPath("data.txt")%><BR>
<%= Server.MapPath("script/data.txt")%><BR>

The preceding scripts produce the following output

c:\inetpub\wwwroot\script\data.txt<BR>
c:\inetpub\wwwroot\script\script\data.txt<BR>

The next two examples use the slash characters to specify that the path returned should be looked up as complete virtual paths on the server.

<%= Server.MapPath("/script/data.txt")%><BR>
<%= Server.MapPath("\script")%><BR>

The preceding scripts produce the following output

c:\inetpub\wwwroot\script\data.txt<BR>
c:\inetpub\wwwroot\script<BR>

The following examples demonstrate how you can use either a forward slash (/) or a backslash (\) to return the physical path to the home directory of the Web site root.

<%= Server.MapPath("/")%><BR>
<%= Server.MapPath("\")%><BR>

The preceding scripts produce the following output

c:\inetpub\wwwroot<BR>
c:\inetpub\wwwroot<BR>

The following examples demonstrate how you can use relative pathing to return the relative physical path to the page that is being viewed in the Web browser.

<%= Server.MapPath("../")%><BR>
<%= Server.MapPath("..\")%><BR>
Applies To

Server Object

©2001-2015 eMill . All trademarks property of their owners.


Transfer

The transfer method sends all of the information that has been assembled for processing by one script enabled content file to a second script enabled content file.

Syntax

Server.Transfer (path)

Parameters
Path
The location of a script enabled content file file to which control should be transferred.
Remarks

When you call Server.Transfer, the state information for all the built-in objects will be included in the transfer. This means that any variables or objects that have been assigned a value in session or application scope will be maintained. In addition, all of the current contents for the request collections will be available to the .asp file receiving the transfer.

If the path you specify in the input parameter is for an .asp file in another application, the .asp file will execute as if it were in the application that contains the Server.Transfer command. In other words, all variables and objects that have been given application scope either by other .asp files in the application or by the application's Global.asa file will be available to the called .asp file. However, the path parameter must not contain an query string or ASP returns an error.

Server.Transfer acts as an efficient replacement for Response.Redirect. Response.Redirect tells the browser to request a different page. Since a redirect forces a new page request, the browser has to make two round trips to the Web server, and the Web server has to handle an extra request. IIS 5.0 introduced a new function, Server.Transfer, which transfers execution to a different ASP page on the server. This avoids the extra round trip, resulting in better overall system performance, as well as a better user experience.

Example

The following example demonstrates transferring from one .asp file to another, as well as sending the session identifier to the client.

The output from these scripts will be:

A session ID

I am going to ASP2

The same session ID

ASP1

<HTML><BODY><%  Dim sessvar1  Response.Write Session.SessionID
  Response.Write ("<BR>")
  Response.Write("I am going to ASP2 <BR>")
  Server.Transfer("/Myasps/ASP2.asp")
%>

ASP2

<HTML>

<BODY><% Response.Write Session.SessionID %></BODY></HTML>

Applies To

Server Object

See Also

Execute, Application Object

©2001-2015 eMill . All trademarks property of their owners.


URLEncode

The URLEncode method applies URL encoding rules, including escape characters, to a specified string.

Syntax

Server.URLEncode( string )

Parameters
string
Specifies the string to encode.
Example

The following script

<%Response.Write(Server.URLEncode("http://www.activeplus.com"))%>

Produces the output:

http%3A%2F%2Fwww%2Eactiveplus%2Ecom
Remarks

See RFC2396 for more details about how to encode a URL.

Applies To

Server Object

See Also

HTMLEncode

©2001-2015 eMill . All trademarks property of their owners.


Session Object

You can use the Session object to store information needed during rendering for a particular receiver. Variables stored in the Session object are available within all content files when rendering a receiver.

Syntax

Session.collection|property|method

Collections
Contents Contains the items that you have added to the session with script commands.
Remarks

You can store values in the Session object. Information stored in the Session object is available during rendering of a particular receiver.

Example

The following script demonstrates storage of two types of variables.

Sub Mail_OnStartRender()
  Session("username") = "Michelle"
  Session("age") = 22
End Sub
See Also

Application Object

©2001-2015 eMill . All trademarks property of their owners.


Soap Object

You can use the Soap object to call a web service method through the SOAP protocol.

Syntax

Soap.property|method

Properties
Version | Contains the SOAP protocol version to use.
Url | Contains the web service URL.
Namespace | Contains the web service namespace.
UserName | Contains the user name used to authenticate eMill during the method call.
Password | Contains the password used to authenticate eMill during the method call.
Methods
CreateObject | Creates and returns a new standalone Soap object.
CreateParams | Creates and returns a Params object used to pass web service method parameters.
Call | Calls the web service method and return the method result.
Remarks

The Soap object properties are read only. When rendering a mailing, these properties are initialized with the active list corresponding parameters (if this list is a SOAP based XML list). If the active list is not a SOAP based XML list or if the Soap object is used out of a mailing render context, any attempt to call Call will generate an error.
The properties of the standalone Soap objects returned by CreateObject are not read only. They must be initialized before calling Call. The standalone Soap objects can be used in every eMill script.

©2001-2015 eMill . All trademarks property of their owners.


Version property

Version

The Version property sets or gets the SOAP protocol version to use. This property can be set either with the value "1.1" or "1.2". Default value is "1.2".

Settings and Return Values

Sets or returns a String value.

Remarks

The Version property can only be set to standalone Soap object.

Example
            Set oSoap = soap.CreateObject
oSoap.Version = "1.1"     'Force
            usage of SOAP protocol version 1.1
oSoap.Url = "http://optin.emill.net/service/services/list.asmx"
oSoap.Namespace = "http://optin.emill.net/service/services"
oSoap.UserName = "test_account@emilltest.com"
oSoap.Password = "pwd"
Set oXmlNode = oSoap.Call("GetLists",, 2)
Applies To
Soap Object
See Also

Url, Namespace, UserName, Password

©2001-2015 eMill . All trademarks property of their owners.


Url property

Url

The Url property sets or gets the Soap web service URL.

Settings and Return Values

Sets or returns a String value.

Remarks

The Url property can only be set to standalone Soap object.

Example
Set oSoap = soap.CreateObject
Set oParams = soap.CreateParams("listId", "2319f42-ab2d-9278-691c-d61cf42ec2dfe")
oSoap.Url = "http://optin.emill.net/service/services/list.asmx"
oSoap.Namespace = "http://optin.emill.net/service/services"
oSoap.UserName = "test_account@emilltest.com"
oSoap.Password = "pwd"
Set oRst = oSoap.Call("GetList", oParams)
Applies To
Soap Object
See Also

Version, Namespace, UserName, Password

©2001-2015 eMill . All trademarks property of their owners.


Namespace property

Namespace

The Namespace property sets or gets the Soap web service namespace.

Settings and Return Values

Sets or returns a String value.

Remarks

The Namespace property can only be set to standalone Soap object. If this properties is empty, it will default to the Url property value.

Example
Set oSoap = soap.CreateObject
Set oParams = soap.CreateParams
oSoap.Url = "http://optin.emill.net/service/services/list.asmx"
oSoap.Namespace = "http://optin.emill.net/service/services"
oSoap.UserName = "test_account@emilltest.com"
oSoap.Password = "pwd"
oParams.Add "listId", "2319f42-ab2d-9278-691c-d61cf42ec2dfe"
Set oRst = oSoap.Call("GetList", oParams)
Applies To
Soap Object
See Also

Version, Url, UserName, Password

©2001-2015 eMill . All trademarks property of their owners.


UserName property

UserName

The UserName property sets or gets the user name value used to authenticate eMill during the method call.

Settings and Return Values

Sets or returns a String value.

Remarks

The UserName property can only be set to standalone Soap object.

Example
Set oSoap = soap.CreateObject
oSoap.Url = "http://optin.emill.net/service/services/list.asmx"
oSoap.Namespace = "http://optin.emill.net/service/services"
oSoap.UserName = "test_account@emilltest.com"
oSoap.Password = "pwd"
Set oRst = oSoap.Call("GetList", soap.CreateParams("listId", "2319f42-ab2d-9278-691c-d61cf42ec2dfe"))
Applies To
Soap Object
See Also

Version, Url, Namespace, Password

©2001-2015 eMill . All trademarks property of their owners.


Password property

Password

The Password property sets or gets the password value used to authenticate eMill during the method call.

Settings and Return Values

Sets or returns a String value.

Remarks

The Password property can only be set to standalone Soap object.

Example
Set oSoap = soap.CreateObject
oSoap.Url = "http://optin.emill.net/service/services/list.asmx"
oSoap.Namespace = "http://optin.emill.net/service/services"
oSoap.UserName = "test_account@emilltest.com"
oSoap.Password = "pwd"
Set oXmlNode = oSoap.Call("GetLists",, 2)
Applies To
Soap Object
See Also

Version, Url, Namespace, UserName

©2001-2015 eMill . All trademarks property of their owners.


CreateObject method

CreateObject

The CreateObject method creates a new standalone Soap object.

Syntax

Soap.CreateObject

Return value

A new standalone Soap object.

Remarks

The new Soap object properties are not read-only and must be initialized before calling Call.

Example
Set oSoap = soap.CreateObject
oSoap.Url = "http://optin.emill.net/service/services/list.asmx"
oSoap.Namespace = "http://optin.emill.net/service/services"
oSoap.UserName = "test_account@emilltest.com"
oSoap.Password = "pwd"
Set oRst = oSoap.Call("GetList", "listId", "2319f42-ab2d-9278-691c-d61cf42ec2dfe")
Applies To
Soap Object
See Also

CreateParams, Call

©2001-2015 eMill . All trademarks property of their owners.


CreateParams method

CreateParams

The CreateParams method create a new Params collection.

Syntax

Soap.CreateParams param1, value1, param2, value2, ..., param10, value10

Parameters
paramX
Optional Variant of subtype String. Adds a new item named paramX with valueX value to the Params collection.
valueX
Optional Variant representing the paramX value.
Return value

A new Params collection.

Remarks

The Params collection is used to pass parameters to the Call method. A Params item can contain a Params sub-collection to form a complex type.

Example
Set oParams = soap.CreateParams("UPC", "745883561292")
oParams.Add "price", "39.99"
oParams.Add "description", soap.CreateParams("shortDesc", "WCF54G-EU", "longDesc", "Linksys PCI Wifi Adapteur WCF54G-EU")
Set oRst = oSoap.Call("method", oParams)
Applies To
Soap Object
See Also

CreateObject, Call

©2001-2015 eMill . All trademarks property of their owners.


Call method

Call

The Call method call a web service method using the SOAP protocol.

Syntax

Soap.Call method, parameters, returnType

Parameters
method
A mandatory String that contains the name of the web service method to call.
parameters
An optional Variant of subtype Params that contains the list of parameters to pass to the web service method.
returnType
An optional Variant of subtype Long defining the type of result to return:
  • 0 = Returns either an ADO Recordset object or a String (default)
  • 1 = Returns the result as a String
  • 2 = Returns the XML node object of the web service method result
  • 3 = Returns an ADO Recordset object if the web service method returns a .NET Dataset, throw an error otherwise
Example
'We assume the active list is an eMill Optin Service subscribers list, so the Soap
'object can initialize its properties using the list corresponding parameters.
Set oParams = soap.CreateParams("listId", "2319f42-ab2d-9278-691c-d61cf42ec2dfe")
Set oRst = soap.Call("GetList", oParams)
Applies To
Soap Object
See Also

CreateObject, CreateParams

©2001-2015 eMill . All trademarks property of their owners.


Json Object

You can use the Json object to parse, manipulate, or serialize data in JSON format.

Syntax

Json.property|method

Methods
CreateObject | Creates and returns a new standalone Json object.
Parse | Convert a JSON string into a variable.
Stringify | Serialize a variable as a JSON string.
Remarks

The Json object properties are added or deleted dynamically using affectations. To add a property to a JSON object, simply affect it to a non empty value. To remove a property, affect it to Empty. Json object properties can also be accessed or affected using the array item syntax. Property names of Json object can be enumerated using the For Each jsoinstruction.

Example
' Creates a Json object named oJson
oJson = JSON.CreateObject()

' Creates a property named api_version and set it to 3
oJson.api_version = 3

' Creates a property named api_url and set its value
oJson("api_url") = "http://api.json.demo/"

' Removes a property named useless
oJson.useless = Empty

' Enumerates the Json object properties by name
For Each name In oJson
   Response.Write "Propery name: " & name & " - Property value: " & oJson(name) & "<br>"
Next
©2001-2015 eMill . All trademarks property of their owners.


CreateObject method

CreateObject

The CreateObject method creates a new standalone Json object.

Syntax

Json.CreateObject

Return value

A new standalone Json object.

Example
Set oJson = Json.CreateObject
Applies To
Json Object
See Also

Parse, Stringify

©2001-2015 eMill . All trademarks property of their owners.


Parse method

Parse

The Parse method convert the a JSON string representation into a variable.

Syntax

Json.Parse json_string

Parameters
json_string
Mandatory Variant of subtype String that contains a JSON serialization string.
Return value

If the JSON string represents an object, JSON.Parse will create a Json object and will populate its properties according to the JSON string. If the JSON string represents an array or a simple type (string, integer, float or boolean), JSON.Parse will return a variable of the corresponding VBScript type. Parse method is fully recursive and can parse nested objects and arrays.

Example
aColors = Json.Parse("[ { color: ""red"", value: &HFF0000 }, { color: ""green"", value: &H00FF00 }, { color: ""blue"", value: &H0000FF } ]")
Applies To
Json Object
See Also

CreateObject, Stringify

©2001-2015 eMill . All trademarks property of their owners.


Stringify method

Parse

The Stringify method convert a variable into its JSON representation.

Syntax

Json.Stringify value

Parameters
value
Mandatory Variant that contains the variable to serialize in JSON format.
Return value

A string representing the convertion of the given value in the JSON serialization format.

Remarks

Stringify method can only convert simple variable types (string, integer, float, boolean and null), arrays and Json objects into a JSON string. Any variable that cannot be represented as a JSON object will trigger an invalid argument error, especially any objects of type not Json. Stringify is fully recursive, it can serialize Json objects and array variables that contain other Json objects or other arrays.

Applies To
Json Object
See Also

CreateObject, Parse

©2001-2015 eMill . All trademarks property of their owners.


DataSource Object

The DataSource object was implemented to avoid eMill from being restricted to one data access technology. eMill includes source code to access any ADO compatible data source. Developers could replace this code with their own code to implement data access to any non ADO database.

Syntax

DataSource.collection|property|method

Properties
BOF | Indicates that the current record position is before the first record.
EOF | Indicates that the current record position is after the last record.

Additional header fields can be set using the Headers collection

Methods
Open | This method opens the data source.
Close | This method closes the data source.
GetRowCount | Returns the number of records in the data source.
CanMovePrevious | Returns True if the record position can move backward.
MoveFirst | Moves the record position to the first record.
Move | Moves the position of the current record.
CanDelete | Returns True if records can be deleted.
Delete | Deletes the current record.
AddNew | Prepares a new empty record.
Update | Updates the current record.
CanUpdate | Returns True if records can be updated.
CancelUpdate | Cancel any pending updates due to a AddNew operation.
Remarks

The DataSource object cannot be accessed directly. The Record object should be used to exchange data between the DataSource object and a script enabled content file.

See Also

Record Object

©2001-2015 eMill . All trademarks property of their owners.


BOF

Specifies whether the current record position is before the first record.

Return Value

Returns a Boolean value.

Remarks

If the returned value is True, the current record is positioned before the first record. Otherwise the returned value is False.

Applies To

DataSource Object

See Also

EOF

©2001-2015 eMill . All trademarks property of their owners.


EOF

Specifies whether the current record position is after the last record.

Return Value

Returns a Boolean value.

Remarks

If the returned value is True, the current record position is after the last record. Otherwise the returned value is False.

Applies To

DataSource Object

See Also

BOF

©2001-2015 eMill . All trademarks property of their owners.


Open

The Open method will open the data source.

Syntax

Sub DataSource_Open()
End Sub

Parameters
None
Applies To

DataSource Object

See Also

Close

©2001-2015 eMill . All trademarks property of their owners.


Close

The Close method will close the data source.

Syntax

Sub DataSource_Close()
End Sub

Parameters
None
Applies To

DataSource Object

See Also

Open

©2001-2015 eMill . All trademarks property of their owners.


GetRowCount

The GetRowCount method returns the number of records in the data source.

Syntax

Function DataSource_GetRowCount()
DataSource_GetRowCount = RecordCount
End Function

Parameters
None
Applies To

DataSource Object

©2001-2015 eMill . All trademarks property of their owners.


CanMovePrevious

The CanMovePrevious method returns True if the record position can be moved backward, otherwise the return value is False.

Syntax

Function DataSource_CanMovePrevious()
DataSource_CanMovePrevious = True/False
End Function

Parameters
None
Remarks
If the record position cannot move backwards, eMill will do a MoveFirst followed by a Move(n)
Applies To

DataSource Object

©2001-2015 eMill . All trademarks property of their owners.


MoveFirst

The MoveFirst method will moves the record position to the first record. If there is no first record, then BOF should return True.

Syntax

Sub DataSource_MoveFirst()
End Sub

Parameters
None
Applies To

DataSource Object

See Also

Move

©2001-2015 eMill . All trademarks property of their owners.


Move

The Move method will move the position of the current record

Syntax

Sub DataSource_Move(NumRecords)
End Sub

Parameters
NumRecords
A signed Long expression that specifies the number of records that the current record position moves.
Remarks

If the NumRecords argument is greater than zero, the current record position moves forward (toward the end of the DataSource). If NumRecords is less than zero, the current record position moves backward (toward the beginning of the DataSource).

Applies To

DataSource Object

See Also

MoveFirst

©2001-2015 eMill . All trademarks property of their owners.


CanDelete

The CanDelete method returns True if the record can be deleted, otherwise False is returned.

Syntax

Function DataSource_CanDelete()
DataSource_CanDelete = True/False
End Function

Parameters
None
Applies To

DataSource Object

See Also

Delete

©2001-2015 eMill . All trademarks property of their owners.


Delete

The Delete method will delete the current record.

Syntax

Sub DataSource_Delete()
End Sub

Parameters
None
Applies To

DataSource Object

See Also

CanDelete

©2001-2015 eMill . All trademarks property of their owners.


AddNew

The AddNew method will creates a new record.

Syntax

Sub DataSource_AddNew
End Sub

Parameters
None
Remarks

The AddNew method should initialize the Record object fields to default values. If the AddNew operation is canceled, CancelUpdate will be called.

Applies To

DataSource Object

See Also

Update, CancelUpdate, CanUpdate

©2001-2015 eMill . All trademarks property of their owners.


Update

The Update method saves any changes you make to the Record object

Syntax

Sub DataSource_Update()
End Sub

Parameters
None
Remarks

Use the Update method to save any changes you make to the current Record object since calling the AddNew method or since changing any field values in an existing record.

Applies To

DataSource Object

See Also

AddNew , CanUpdate

©2001-2015 eMill . All trademarks property of their owners.


CanUpdate

The CanUpdate method returns True if the record can be updated.

Syntax

Function DataSource_CanUpdate()
DataSource_CanUpdate = True/False
End Function

Parameters
None
Applies To

DataSource Object

©2001-2015 eMill . All trademarks property of their owners.


CancelUpdate

The CancelUpdate method will cancel any pending updates due to a AddNew operation.

Syntax

Sub DataSource_CancelUpdate()
End Sub

Parameters
None
Applies To

DataSource Object

See Also

AddNew

©2001-2015 eMill . All trademarks property of their owners.


CSafeStr

CSafeStr returns an expression that has been converted to a Variant of subtype String. CSafeStr is similar to CStr except that the expression can be set to Null or Empty.

Syntax

CSafeStr(expression)

Parameters
expression
Any kind of Variant. The Variant can be of type Null or Empty
Return Value

A Variant of subtype String. If the expression is Null or Empty, an empty string ("") is returned.

Example

<%
sName = CSafeStr(Record.Fields("Name"))
%>

See Also

VBScript Reference

© 2001-2015 eMill . All trademarks property of their owners.


DefaultStr

DefaultStr returns a default Variant of subtype String if the passed expression is a Variant of subtype Null or Empty, or if the passed string expression is empty.

Syntax

DefaultStr(expression, default)

Parameters
expression
Any kind of Variant. The Variant can be of type Null or Empty
default
Any kind of Variant
Return Value

A Variant of subtype String.

Example

Dear <%=DefaultStr(Record.Fields("Name"), "Customer"%>,

See Also

VBScript Reference

© 2001-2015 eMill . All trademarks property of their owners.


HtmlToText

Converts HTML or XHTML encoded text to plain text.

Syntax

HtmlToText(html)

Parameters
html
A Variant of subtype String or an Array of Byte
Return Value

A Variant of subtype String.

Example

<%Response.Write HtmlToText(Mail.Contents("HTMLNote").Data)%>

©2001-2015 eMill . All trademarks property of their owners.


EncodeBase64Str

EncodeBase64Str returns a Variant of subtype String that contains the passed string as Base64 encoded.

Syntax

EncodeBase64Str(expression)

Parameters
expression
A Variant of subtype String.
Return Value

A Variant of subtype String.

Remarks
EncodeBase64Str does not directly encode the passed string to a Base64 string. It first converts it to a utf-8 string, encode the utf-8 string to base64 and return the base64 string in a BSTR.
Therefore a string in any language (asian, arabic, european,...) may be converted to the base64 format.
Example

<%
Mail.Headers("X-ProjectName") = EncodeBase64Str("Picasso est né le 25 octobre 1881 à Malaga")
' base64 string = "UGljYXNzbyBlc3QgbsOpIGxlIDI1IG9jdG9icmUgMTg4MSDDoCBNYWxhZ2E="
%>

See Also

VBScript Reference, DecodeBase64Str

 ©2001-2015 eMill . All trademarks property of their owners.


DecodeBase64Str

DecodeBase64Str returns a Variant of subtype String that contains decoded version of a base64 encoded expression.

Syntax

DecodeBase64Str(expression, charset)

Parameters
expression
A Variant of subtype String.
charset
An optional Variant of subtype String that contains the charset of the string that was encoded.
Return Value

A Variant of subtype String.

Remarks
If charset is not specified, the function use utf-8. If the encoded string was a 2 bytes unicode string, the charset must be of type utf-16.
Example

<%
sProjectName = DecodeBase64Str(Mail.Headers("X-ProjectName"))
%>

See Also

VBScript Reference, EncodeBase64Str

 ©2001-2015 eMill . All trademarks property of their owners.


FormatEmailAddress

FormatEmailAddress returns a Variant of subtype String that contains a formatted email address.

Syntax

FormatEmailAddress(email, firstName, LastName)

Parameters
email
A Variant of subtype String.
firstName
An optional Variant of subtype String.
lastName
An optional Variant of subtype String.
Return Value

A Variant of subtype String.

Remarks
The email parameter must be valid otherwise FormatEmailAddress will throw an error.
FormatEmailAddress builds a display name using the firstName and lastName parameters. Extra spaces are removed and the first letter of each word is set to uppercase, and the following letters are set to lowercase.
If both firstName and lastName are missing or invalid, FormatEmailAddress just returns the email parameter.
Example

<%
Mail.From = FormatEmailAddress("jim.clark@emilltest.com", "jim", "clark")
' returns a string containing "Jim Clark" <jim.clark@emilltest.com>
%>

See Also

VBScript Reference, ExtractEmailAddresses

©2001-2015 eMill . All trademarks property of their owners.


ExtractEmailAddresses

ExtractEmailAddresses returns a Variant of subtype String or Array of strings that contains all the addresses found in the buffer parameter.

Syntax

ExtractEmailAddresses (buffer, asArray)

Parameters
buffer
A Variant of subtype String or Array of bytes
asVariant
An optional Variant of subtype Bool.
Return Value

A Variant of subtype String or Array of strings.

Remarks
If asArray is missing or set to False, ExtractEmailAddresses returns the extracted email addresses as comma separated, otherwise, ExtractEmailAddresses returns the extracted email addresses as a string array.
If no addresses are found, or if buffer is not a string or a byte array, ExtractEmailAddresses returns either an empty string or an empty string array.
Example

Sub Mailing_OnReceiveMail()
    Dim sUnsubscribeEmail

    If InStr(1, UCase(Mail.Subject), "UNSUBSCRIBE", vbTextCompare) > 0 Then
        sUnsubsribeEmail = ExtractEmailAddresses(Mail.Subject)
    End If

    ...
End Sub

See Also

VBScript Reference, FormatEmailAddress

 ©2001-2015 eMill . All trademarks property of their owners.


CreateUniqueID

Generates a 128 bit unique identifier in form of a string of 26 characters in length. All characters are in upper case (A-Z, 0-9).

Syntax

CreateUniqueID()

Parameters
none
Return Value

A Variant of subtype String.

Example

<%Response.Write "A unique id: " & CreateUniqueID()%>

©2001-2015 eMill . All trademarks property of their owners.


GetHttpFile

GetHttpFile returns a Variant of subtype Byte array or String that contains the result of the HTTP request.

Syntax

GetHttpFile(url, userName, password, fields, charset)

Parameters
url
A Variant of subtype String.
userName
An optional Variant of subtype String.
password
An optional Variant of subtype String.
fields
An optional Variant of subtype String or String array.
charset
An optional Variant of subtype String.
Return Value

A Variant of subtype String if the HTTP server returns a content of type text, a Byte array otherwise.

Remarks
The url parameter must be a valid HTTP or HTTPS url. Both userName and password can be provided to perform HTTP authentication. The field parameter contains the data to post to the url resource. It is either a string of field: value pair separated by carriage return or a string array of field: value pair. field data is encoded using the current charset or using the charset parameter if provided.
Example
<%
    Response.Write GetHttpFile("http://www.emill.net")
    ' Write a string containing the http://www.emill.net page content.
%>
See Also

VBScript Reference

© 2001-2015 eMill . All trademarks property of their owners.


CreateUniqueID

DecodeInternetDate

Convert an RFC822 datetime string to a DATE variant.

Syntax

DecodeInternetDate(internetDate)

Parameters
date
Return Value

A Variant of subtype Date. An error is thrown if the convertion fails

Example

<% Response.Write "An internet datetime: " & DecodeInternetDate("13 Dec 2010 08:00:02 +0100") %>

©2001-2015 eMill . All trademarks property of their owners.


CreateUniqueID

IsJokerMatch

Determines if a string matches a pattern.

Syntax

IsJokerMatch(string, pattern)

Parameters
string
A String to be checked.
pattern
A String pattern to check for match against string.
Return Value

A Variant of subtype Bool equals to True is string matches pattern, False otherwise.

Note

pattern string can contain * and ? jokers. The * joker matches any string char zero or more times. The ? joker matches any string char exactly one time. Other characters match their case insensitive equivalent.

Examples

IsJokerMatch("abcd", "a*d") returns True.
IsJokerMatch("abc", "a?c") returns True.
IsJokerMatch("abc", "a??c") returns False.
IsJokerMatch("john@emilltest.com", "*??@??*.??*") returns True.
IsJokerMatch("a@b.c", "*??@??*.??*") returns False.

©2001-2015 eMill. All trademarks property of their owners.


Server Side Scripting Samples

Server side scripting samples are located in the My Documents\eMill Projects\Samples folder.

© eMill 2001-2015 . All trademarks property of their owners.


Importing from the clipboard

If eMill is not able to import addresses from a file, you can open the file from its native application and copy the content to the clipboard. eMill will extract the addresses from the clipboard.
  • Open the file from its application and copy the content to the clipboard.
  • Starting a new project or changing the current data source, check 'Import from unstructured text files' from the data source selection box and select 'Import email addresses from the clipboard':
The total number of email addresses imported into the new project database is displayed. This database only includes the email address fields. You can import from several files by saving to a different database each time, and merge all in the database.mdb from the Receivers View or using Microsoft Access.

© eMill 2001-2015 . All trademarks property of their owners.


Incoming Queues

Prior to subscribing the project 'inbox' message folder, you must pre-configure the incoming queues from the options box. Queues displayed in the right list are the actual email inboxes residing on mail servers (e.g. 'From', 'Reply-To', 'Errors-To' addresses) that are specified in the header. Queues displayed in the left list are those that will be polled for messages to transfer to the project 'inbox' folder.
  • From the Queue/Mailing/Properties menu, click on the Incoming Queues tab:
  • Highlight one or more queues from the Available queues list.
  • Click on Add to subscribe the project inbox to the queue(s). You may unsubscribe the inbox from a queue by highlighting it from the left list and clicking on Remove.
Note: Messages transferred from the incoming queues to the project 'inbox' remain on the server. Deleting the messages as they are retrieved is achieved through scripting using the OnAcceptMail event from the Mailing class. Refer to the global script section.

© eMill 2001-2015 . All trademarks property of their owners.


Using components and objects

COM components are the key to building powerful, real-world Web applications. Components provide functionality that you use in your scripts to perform specialized tasks, such as executing financial transactions or validating data. ASP also provides a set of base components that you can use to greatly enhance your scripts.

About Components:

A COM component is a reusable, programmatic building block that contains code for performing a task or set of tasks. Components can be combined with other components (even across networks) to create a Web application. COM components execute common tasks so that you do not have to create your own code to perform these tasks. For example, you can use a stock ticker component to display the latest stock quotes on a Web page. However, it would be difficult to create a script that provides the same functionality. Also, the script would not be as reusable as a component.

If you are new to scripting, you can write scripts that use components without knowing anything about how the component works. ASP comes with base components that you can use immediately. For example, you can use the ActiveX Data Objects (ADO) components to add database connectivity to your Web pages. Additional components can also be obtained from third-party developers.

If you are a Web application developer, components are the best way to encapsulate your business logic into reusable, secure modules. For example, you could use a component to verify credit card numbers by calling the component from a script that processes sales orders. Because the verification is isolated from the order process, you can update the component when the credit card verification process changes, without changing your order process. Also, since COM components are reusable, you could reuse the component in other scripts and applications. Once you have installed a component on your Web server, you can call it from a ASP server-side script, an ISAPI extension, another component on the server, or a program written in another COM-compatible language.

You can create components in any programming language that supports the Component Object Model (COM), such as C, C++, Java, Visual Basic, or numerous scripting languages. (If you are familiar with COM programming, COM components are also known as Automation servers.) To run on the Web server, your COM components cannot have any graphical user interface elements, such as the Visual Basic MsgBox function; graphical interface elements would only be viewable on the server, and not the browser.

Creating an Instance of a Component's Object:

A component is executable code contained in a dynamic-link library (.dll) or in an executable (.exe) file. Components provide one or more objects, self contained units of code which perform specific functions within the component. Each object has methods (programmed procedures) and properties (behavioral attributes). To use an object provided by a component, you create an instance of the object and assign the new instance to a variable name. Use the ASP Server.CreateObject method or the HTML <OBJECT> tag to create the object instance. Use your scripting language's variable assignment statement to give your object instance a name. When you create the object instance, you must provide its registered name (PROGID). For the base components provided with ASP, you can get the PROGID for the objects from the reference pages (see Installable Components for ASP).

For example, the Ad Rotator component randomly rotates through a series of graphical advertisements. The Ad Rotator component provides one object, called the Ad Rotator object, whose PROGID is "MSWC.AdRotator." To create an instance of the Ad Rotator object, use one of the following statements:

VBScript:

<% Set MyAds = Server.CreateObject("MSWC.AdRotator") %>

JScript:

<% var MyAds = Server.CreateObject("MSWC.AdRotator") %>

If you are already familiar with VBScript or JScript, note that you do not use the scripting language's function for creating a new object instance (CreateObject in VBScript or New in JScript). You must use the ASP Server.CreateObject method; otherwise, ASP cannot track your use of the object in your scripts.

You can also use the HTML <OBJECT> tag to create an object instance. You must supply the RUNAT attribute with a value of Server, and you must provide the ID attribute set to the variable name you will use in your scripts. You can identify the object by using either its registered name (PROGID) or its registered number (CLSID).The following example uses the registered name (PROGID) to create an instance of the Ad Rotator object:

<OBJECT RUNAT=Server ID=MyAds PROGID="MSWC.AdRotator"></OBJECT>

The following example uses the registered number (CLSID) to create an instance of the Ad Rotator object:

<OBJECT RUNAT=SERVER ID=MyAds
CLASSID="Clsid:1621F7C0-60AC-11CF-9427-444553540000"></OBJECT>

Use Scripting to Create COM Components:

ASP supports Windows Script Components, Microsoft's powerful scripting technology that you can use to create COM components. Specifically, you can encapsulate common scripts, such as those used for database access or content generation, into reusable components accessible from any .asp file or program. You can create Windows Script Components by writing scripts in a language such as VBScript or JScript without a special development tool. You can also incorporate Windows Script Components into programs written in COM compliant programming languages, such as Visual Basic, C++, or Java.

The following is an example of a Windows Script Components, written in VBScript, that defines methods for converting temperature measurements between Fahrenheit and Celsius:

<SCRIPTLET>

<Registration
    Description="ConvertTemp"
    ProgID="ConvertTemp.Scriptlet"
    Version="1.00"
>
</Registration>

<implements id=Automation type=Automation>
    <method name=Celsius>
        <PARAMETER name=F/>
    </method>
    <method name=Fahrenheit>
        <PARAMETER name=C/>
    </method>
</implements>

<SCRIPT LANGUAGE=VBScript>

  Function Celsius(F)
      Celsius = 5/9 * (F - 32)
  End Function

  Function Fahrenheit(C)
      Fahrenheit = (9/5 * C) + 32
  End Function

</SCRIPT>
</SCRIPTLET>

Before implementing this Windows Script Component you must save this file with an .sct extension and then in Windows Explorer, right-click this file and select Register. To use this Windows Script Component in a Web page, you would use a server-side script such as the following:

<%
  Option Explicit

  Dim objConvert
  Dim sngFvalue, sngCvalue

  sngFvalue = 50
  sngCvalue = 21

  Set objConvert = Server.CreateObject("ConvertTemp.Scriptlet")
%>

<%= sngFvalue %> degrees Fahrenheit is equivalent to <%= objConvert.Celsius(sngFvalue) %> degrees Celsius<BR>

<%= sngCvalue %> degrees Celsius is equivalent to <%= objConvert.Fahrenheit(sngCValue) %> degrees Fahrenheit<BR>

Using ASP Built-in Objects:

ASP also provides built-in objects for performing useful tasks that simplify Web development. For example, you can use the Request object to easily access information associated with an HTTP request, such as user input coming from HTML forms or cookies. Unlike using the objects provided by a COM component, you do not need to create an instance of an ASP built-in object to use it in your scripts. These objects are automatically created for you when the ASP request starts processing. You access the methods and properties of a built-in object in the same way in which you access the methods and properties of a component's objects, as described in this topic. For a complete description of the built-in objects, see Active Server Pages Objects Quick Reference Card.

Calling an Object Method:

A method is an action you can perform on an object or with an object. The syntax for calling a method is:

Object.Method parameters

The parameters vary depending on the method.

For example, you can use the Write method of the Response built-in object to send information to the browser as shown in the following statement:

<% Response.Write "Hello World" %>

Note Some scripting languages do not support the Object.Method syntax. If your language does not, you must add an entry to the registry in order to use that language as your primary scripting language. See Working with Scripting Languages for more information.

Setting an Object Property:

A property is an attribute that describes the object. Properties define object characteristics, such as the type of the object, or describe the state of an object, such as enabled or disabled. The syntax is:

Object.Property

You can sometimes read and set the value of a property. In addition, for some objects, you can also add new properties.

For example, the Ad Rotator component has a property, Border, which specifies whether the ad has a border around it and determines the border thickness. The following exPREssion specifies no border:

<% MyAds.Border = 0 %>

For some properties, you can display the current value by using the ASP output directive. For example, the following statement returns TRUE if the browser is still connected to the server:

<%= Response.IsClientConnected %>
© eMill 2001-2015 . All trademarks property of their owners.


Add

The Add method adds an item to a collection.

Syntax

Collection.Add([key][, value])

Parameters
key
The unique key for the item to add. This parameter is optional.
value
The value to set
Example

The following example adds an item to the Receivers collection.

<%
   Mail.Receivers.Add "jim@emilltest.com"
%>

The following example adds an item with a key to the Receivers collection.

<%
   Mail.Receivers.Add "jim", "jim@emilltest.com"
   sJimEmail = Mail.Receivers("jim")
%>
Remarks

An alternative method to add an item is use an explicit key. e.g:
Mail.Receivers("joe") = "joe@emilltest.com"

Applies To

Collection Object

©2001-2015 eMill . All trademarks property of their owners.


Count

Returns the number of items in a collection.

Syntax

Collection.Count

Return Value

Returns a Long value.

Example

Response.Write "We have " & Family.Childrens.Count & " kids and they are named:<br>"

For iItem = 0 to Family.Childrens.Count-1
  Response.Write Family.Childrens(iItem) + "<br>"
Next

The same could be written using the For Each syntax:

 For Each child In Family.Childrens
  Response.Write Family.Childrens(child) + "<br>"
Next

Remarks

Because numbering for members of a collection begins with zero, you should always code loops starting with the zero member and ending with the value of the Count property minus 1. In VBScript it is preferable to use the For Each ... Next syntax.

Applies To

Collection Object

©2001-2015 eMill . All trademarks property of their owners.


Collection Object

All collections in eMill use the the following syntax and methods

Syntax

Item = Object.Collection(key|index)

Parameters
key
The identifier for the item to return.
index
An index offset indicating which item in the list to return. The index starts at 0
Return Value
A Variant that contains the value stored in the collection. The Variant can be of any type.
Properties
Count Returns the number of items in the collection.
Methods
Remove | Deletes an item from the collection.
RemoveAll | Deletes all items from the collection.
Add | Add an item to the collection.

©2001-2015 eMill . All trademarks property of their owners.


Contents

Remove

The Remove method deletes an item from a collection.

Syntax

Collection.Remove(key|index)

Parameters
key
The identifier for the item to remove.
index
An index offset indicating which item in the list to remove.
Remarks

The Remove method takes either a string or an integer as an input parameter. If the input parameter is a string, the method will search the contents collection for an item with that name and remove it. If the input parameter is an integer, the method counts that number of items from the start of the collection, and removes the corresponding item.

Example

The following example adds two items to the Application.Contents collection and removes the second one.

<%
   Record.Fields("strFirst")=("First thing")
   Record.Remove("strFirst")
%>
Applies To

Collection Object

See Also

RemoveAll

©2001-2015 eMill . All trademarks property of their owners.


Contents

RemoveAll

The RemoveAll method removes all items that have been added to the collection.

Syntax

RemoveAll()

Applies To

Collection Object

See Also

Remove

©2001-2015 eMill . All trademarks property of their owners.


Data

The Data property is used to access the MIME source.

Settings and Return Values

Set or returns a String value that contains the MIME source.

Remarks

It is also possible to set this property with a Variant of subtype Array of Byte.

Applies To

Mail Object

See Also

Content.Data

©2001-2015 eMill. All trademarks property of their owners.


Save

The Save method will save the Mail Object as a MIME file (.eml).

Syntax

Mail.Save(FileName)

Parameters
FileName
A String specifying the new file name for the mail to be saved.
Remarks
Mail Contents that include VBScript code will be rendered at that time.
Example

Mail_OnReceiveMail
Mail.Save "c:\temp\mail.eml"
End Sub

Applies To

Mail Object

See Also

Content.Save

©2001-2015 eMill . All trademarks property of their owners.


Date

SendDate

The SendDate property specifies the date and time the message should be sent.

Settings and Return Values

Sets or returns the Date value. The date may be a Variant of type Date or String. The string may specify a classic date/time format or an rfc822 date/time format. If the time is specified but not the date, the date will be set with the current system date.

Applies To

Mail Object

©2001-2015 eMill . All trademarks property of their owners.


Record.Trim

Trim

The Trim property specifies if fields are trimmed or not.

Settings and Return Values

Sets or returns a Boolean Value.

Remarks

Set to True to remove both leading and trailing spaces from all record fields, set to False to leave unchanged. The default value is True.

Applies To

Record Object

©2001-2015 eMill . All trademarks property of their owners.