Version 2.5

A FileMaker Pro 4.x/5.x plug-in

 

Developed by

 

Comm-Unity Networking Systems

 

Emailing with FileMaker has never been so easy and flexible!

 

Continue

 

 

 

 

 

 

 

 

 

 

 

Table Of contents

 

 

 

 

 

 

 

 

 

 

 

 

Introduction [Index]


Sending Email from within FileMaker Pro puts you in the driver’s seat for complete communication. SMTPit allows you to send Email with several custom made features that just are not available in other products.

With SMTPit, mail merges are easy with our header and footer implementations. Imagine having a custom introduction to each of your customers aimed directly at them, calling them by name. From mailing lists to newsletters, SMTPit makes it simple, giving you the ability to have custom headers and footers for each Email.

SMTPit also works well with Web Companion solutions. Imagine sending personalized thank you notes to every web visitor that fills out one of your web forms. You could even tailor those thank you notes with product details based on the web visitor’s interests.

SMTPit also has the ability to send HTML only emails, or multipart/alternative Text & HTML emails for those email clients that do not understand HTML content. Plus, you can include inline HTML images to provide graphic logos or other images in your HTML emails.

Since SMTPit is so flexible, there are countless solutions. Imagination is the only limitation.

 

Features

SMTPit enables you to send Email directly from FileMaker Pro using To, From, CC, BCC, Email Headers, and Attachments. Plus, we have a few added features such as a header and footer that are added to the body of email messages. We also have added functions to send HTML messages very easily. For your convenience, we have created a Configuration Dialog that allows you to set default settings of each feature.

 

Installation and Configuration [Index]


To install the plug-in, first make sure FileMaker Pro is closed. Next, unzip the SMTPit zip file on Windows, or unstuff the SMTPit stuffit file on Macintosh, and then double-click the SMTPit_Installer application. This will automatically place the SMTPit plug-in file into the "System" folder on Windows, or the "FileMaker Extensions" folder on Macintosh, inside your FileMaker Pro 4.x or 5.x folder. If you have a previous version of SMTPit, the installer will overwrite it. (Note: The Installer will not run from inside an Unzipping program like WinZip. You must unzip it to a folder before running the installer.)

After you install the plug-in as described above, open FileMaker and set the default preferences. To do this, go to Edit->Preferences->Application, click on the Plug-ins tab, and double-click the SMTPit plug-in.

 

Basics [Index]


Once the Configuration Dialog is open, click the "Basics" tab (See Figure 1) and enter your SMTP host in the "SMTP Host" field, your Email Address in the "From" field, your Name in the "From Name" field, a default Subject in the "Subject" field, and set a default Priority with the "Priority" drop down list.

SMTPit will refer to the default settings when you do not specifically set values in your scripts. In other words, if you do not define a from email address in your SMTPit related script, SMTPit will use the Default From address.

SMTPit waits for a certain amount of time for your SMTP host to respond. By default, this is set to 30 seconds. However, you can adjust the setting to fit your needs by entering a different value in the "Connection Timeout" field. SMTPit breaks lines after 80 characters by default (because of SMTP Protocol standards), but you can change this by setting the "SMTP Line Break Column" field.

 

Figure 1
Basics Tab

On this tab, you define your Default SMTP Host, From Address, From Name, Subject, and Priority. The Connection Timeout is also here.

 

Headers and Footers [Index]


SMTPit has the unique ability to add headers and footers to the Plain Text Body and HTML Body of email messages. To enter a default header or footer simply click on one of the "Header" or "Footer" tabs (See Figure 2) in the Configuration Dialog. Then simply click in the edit field to enter a default header or footer. Like most SMTPit functions, you can replace the default values in your current scripts with values from fields in your database. You can also use the related append functions to add to the default headers and footers.

Because of this function, you can easily insert personal information into your email messages. You could have a default header and footer, and use the SMTP-HeaderAppend function to add a personal message or name to each email message. Another solution is to have a header or footer field in your database that is a calculation. With this scenario you could dynamically insert product information from your database into each email. Keep in mind that SMTPit also has a SMTP-BodyAppend and a SMTP-HTMLBodyAppend function that can be integrated into such a solution.

 

Figure 2
Header Tab

On this tab, you define your Default Text Header, which SMTPit places in the Text Body of your email message.

 

Attachments [Index]


SMTPit 2.0 introduced the ability to send attachments either using the default attachments set in the Configuration Dialog (See Figure 3) or via five functions: SMTP-AttachAssign, SMTP-AttachAppend, SMTP-DlgAttachAssign, SMTP-DlgAttachAppend, and SMTP-FileNameAcquire. To set a default attachment, one that is always sent, click on the "Add" button on the Attachments tab. After you click the add button, a Standard Open Dialog will pop up which will allow you to navigate to your desired attachment. Once you have found the file you want to attach, simply click the open button. To add additional default attachments, simply repeat the process above.

As mentioned above SMTPit 2.0 added five new functions related to attachments. The SMTP-AttachAssign and the SMTP-AttachAppend functions require a complete path to a valid file. To make sure you have the correct path, use the SMTP-FileNameAcquire function, which will present you with a Standard Open Dialog to locate the desired file. (Note: SMTP-FileNameAcquire only returns a valid path. It does not use the selected file as an attachment.) The SMTP-DlgAttachAssign and the SMTP-DlgAttachAppend present you with a Standard Open Dialog to choose an attachment just like the Configuration Dialog mentioned in the last paragraph. For more information on these functions, refer to the SMTPit External Functions Reference section of this documentation or refer to the SMTPit_Functions database that came with the SMTPit 2.5 archive.

Figure 3
Attachments Tab

On this tab, you define the Attachments that you want to send with every email you send with SMTPit.

 

HTML Images [Index]


SMTPit 2.5 introduces the ability to send HTML emails with very little difference from sending Plain Text emails. With this new ability, comes the ability to send Inline HTML Images for display in the HTML emails. You can either assign default HTML Images in the Configuration Dialog (See Figure 4), or add HTML Images via four new functions: SMTP-HTMLImageAssign, SMTP-HTMLImageAppend, SMTP-DlgHTMLImageAssign, and SMTP-DlgHTMLImageAppend. To set a default HTML Image, one that is always sent, click on the "Add" button on the Attachments tab. After you click the add button, a Standard Open Dialog will pop up which will allow you to navigate to your desired HTML Image. Once you have found the image you want, simply click the open button. To add additional default HTML Images, simply repeat the process above.

As mentioned above, SMTPit 2.5 added four new functions related to HTML Images. The SMTP-HTMLImageAssign and the SMTP-HTMLImageAppend functions require a complete path to a valid file. Like the related Attachment functions, you can make sure you have the correct path by using the SMTP-FileNameAcquire function, which will present you with a Standard Open Dialog to locate the desired HTML Image. (Note: SMTP-FileNameAcquire only returns a valid path. It does not use the selected file as an HTML Image.) The SMTP-DlgHTMLImageAssign and the SMTP-DlgHTMLImageAppend functions present you with a Standard Open Dialog to choose an HTML Image just like the Configuration Dialog mentioned in the last paragraph. For more information on these functions, and on using inline HTML Images, refer to the "Using Inline HTML Images" and the SMTPit External Functions Reference sections later in this documentation, or refer to the SMTPit_Functions database that came with the SMTPit 2.5 archive.

Figure 4
HTML Images

On this tab, you define the HTML Images that you want to send with every email you send with SMTPit.

 

Email Headers [Index]


SMTPit 2.0 also introduced the ability to insert extra Email Headers into your email messages. For example, you can identify your company by creating an Email Header with the name, "Company", and the value being the name of your company. When the recipient gets your email message they will see "Company: Your Company Name" at the top of the email. It is important that you do not have any spaces in the Name of the header due to Email Header specifications, however, you can have spaces in the value. You can also use Email Headers to track different email promotions or use in conjunction with POP3it to run a script based on an Email Header.

To add a Default Email Header simple click on the add button as shown above (See Figure 5), then type in your desired header name in the name field with the desired value in the value field. You can also add email headers dynamically by using the SMTP-EmailHeaderAppend function, which will append new headers. The default Email Headers you define in the Configuration Dialog will be appened to the Header of the Email first.

Figure 5
E-Headers Tab

This dialog box opens when you press the "Add" button on the E-Headers tab. It allows you to define a Default Email Header.

 

After Send [Index]


 

The "After Send" settings (See Figure 6) will determine what action SMTPit takes after sending each email. If you would like SMTPit to pop up a dialog window letting you know that your email message was sent, check off the "Popup 'Email Sent Successfully' Dialog" option. This option is often helpful when debugging your scripts.

You also have the option to clear the following fields: To, From, From Name, Subject, CC, BCC, Body, Header, Footer, Attachments, Email Headers, HTML Body, HTML Header, HTML Footer, HTML Images, and Priority. Fields that are checked will clear after each email message is sent. Fields that are not checked retain their set values after each email message is sent.

To better explain this, here is an example scenario: You have a database of contacts and you want to send a form letter to each of those contacts. The body of each of these emails is exactly the same, but you want the subject to say "Dear Frank", where "Frank" is the name of the contact. To do this, put "Dear " in the "Subject Field" on the "Basics" tab, and on the "After Send" tab, check off "To" and "Subject", and leave everything else unchecked. Next, make a script for your database that first assigns the body of the message and then goes into a loop to send all the messages. Inside this loop, you only have to assign the "To" field, and use "SMTP-SubjectAppend" to add on the contact's name. Everything else, including the body, will be retained after each email is sent for use in the next email.

 

Figure 6
After Send Tab

On this tab, you define what action SMTPit takes after sending each email.

 

About [Index]


The About Tab simply reports which version of SMTPit that you are using. You can also use the SMTP-Version function to bring up the Configuration Dialog by passing the function the string "CONFIGURE" or the string "ABOUT". To make sure that you have the most resent version of SMTPit, please visit our website (http://www.filemaker.comm-unity.net).

 

Registering

With version 2.0 of SMTPit and in future versions, you can register SMTPit from the Configuration Dialog (See Figure 7) once you have purchased it from our secure website or by ordering by phone. After you purchase SMTPit 2.0, we will send you a serial number to register your copy by using the "Register" button in the Configuration Dialog. We have also decided to include a register function so that developers can easily register SMTPit with their bound solutions once they have purchased a Developers license. For more information on purchasing SMTPit and other exciting plug-ins, visit our website (http://www.filemaker.comm-unity.net) and choose the "Purchase" link from the tool bar.

Figure 7
Registering

This dialog opens after you click on the "Register" button so that you can register your copy of SMTPit.

 

How to Use FileMaker Plug-ins [Index]


FileMaker Inc. introduced a very simple plug-in architecture when they released FileMaker Pro 4.0. Originally intended to aid only in complex calculations, the plug-in architecture took off in ways that FileMaker Inc. had not expected. Though there are now many different types of plug-ins, they all work the same basic way. By understanding the basics of plug-in interaction you will be able to understand how many developers approach plug-in development.

To start with, plug-ins are used by creating calculations. You can use calculations in many places within FileMaker including a calculation field, the "Set Field" script step, the "Paste Result" script step, as well as a text field that has a calculated value. There are a couple of other ways to create calculations, but these are the major avenues that are currently being used for plug-ins. The most commonly used avenue for plug-ins is the "Set Field" script step. It is easy to use, plus, the plug-in can report its actions in the field that you are setting.

FileMaker's External Plug-in architecture is as follows:

External ("FunctionNamePrefix-FunctionName", parameter)

For example if you take our Version function, which returns the version of SMTPit that you are using, it would look like this:

External ("SMTP-Version", parameter)

To actually use the function though, you will have to give it a parameter. Since the Version function does not need any special information, you can just set it to the empty string ("") in order to use the function:

External ("SMTP-Version", "")

The parameter of the plug-in architecture is where you put the information for the related function. For example, if you are setting your from address using the SMTP-FromAssign function, it would look like this:

External ("SMTP-FromAssign", "you@yourdomain.com")

Or if you are using a text field or a global field named "FromField" to hold your email address value, it would look like this:

External ("SMTP-FromAssign", FromField)

The difference between using a field to hold the value and putting the real value into the calculation is the quotation marks. This is because FileMaker will interpret anything not in quotes as a field in your database.

Though the calculation dialog box is limited in space, FileMaker has made it somewhat easier to deal with functions by using their groupings of functions in the top right corner of the calculation dialog. To view all of the plug-in functions currently installed, choose view by "External Functions". Once chosen, you should see the Web companion external functions, and if you have SMTPit installed you will see the SMTPit functions listed as well. Choosing to view by "External Functions" can greatly increase the ease of your script writing because the functions that you need are right there at your finger tips.

 

Mailer Example Explained [Index]


This section of the documentation will show you, step by step, how the Mailer Example database works so that you can understand how to use SMTPit in your own solutions.

First of all there are sixteen fields defined in the solution. You will not necessarily need all of the fields mentioned to send email from your solution. The fields defined in this solution are the following:

Field Name

Field Type

Formula / Entry Option

Record Date

Date

Auto-enter the: "Creation Date"

To

Text


To Name

Text


From

Global(Text)


From Name

Global(Text)


Header

Calculation(Text)

= "Dear" & To Name & ", ¶¶"

Body

Global(Text)


Footer

Global (Text)


HTMLHeader

Calculation(Text)

"<html>¶" & "<body>¶" & "<p>Dear " & To Name & ",</p>¶"

HTMLBody

Global(Text)


HTMLFooter

Global (Text)


Attachment

Text


Result

Text


Full Result

Text


ReadMe

Text


Note that not all fields are text. The From, From Name, Subject, Body, Footer, HTML Body, and HTML Footer are global fields which will allow you to have the same value for each record in your database. An alternative way to do this would be to use the default settings in the Configuration Dialog as discussed earlier in this documentation. Another type of field is used for the Header and HTML Header fields, which are calculations. These are very simple calculations that return a greeting and the name of the person defined in the current record. Note that the calculated result is set to text.

 

Send Mail - Text Script

Now that you know the fields in the database, let us look at the "Send Mail - Text" script.

Script Step

Script Parameters

Comment

Specify Button:

Clear old settings, and create new email settings based on current record

Set Field

Field Button:

Full Result

Specify Button:

External("SMTP-ClearAll", "") & "¶" & External("SMTP-ToAssign", To Name & " <" & To & ">") & "¶" &
External("SMTP-FromAssign", From) & "¶" &
External("SMTP-FromNameAssign", From Name) & "¶" &
External("SMTP-SubjectAssign", Subject) & "¶" &
External("SMTP-HeaderAssign", Header) & "¶" &
External("SMTP-BodyAssign", Body) & "¶" &
External("SMTP-FooterAssign", Footer) & "¶" & External("SMTP-AttachAssign", Attachment)

Comment

Specify Button:

Send Message

Set Field

Field Button:

Result

Specify Button:

External("SMTP-Send", "")

Comment

Specify Button:

Copy Send Message Result to the Full Debug Result

Set Field

Field Button:

Full Result

Specify Button:

Full Result & "¶" & Result

The first step is simply a comment field telling you what the next step will accomplish.

The second script step sets the field "Full Result" to all of the needed information to send the email. Note that the SMTP-ToAssign is a mixture of the two fields To Name and To using the greater than and less than signs in quotes to create a complete email address in the form, "John Smith ". This format can be used for the To function as well as the CC, BCC, and their related append functions. To create a free form name for the From address you will need to use the SMTP-FromNameAssign function because of email header standards. Everything else in this script step is straight forward, simply setting values from fields to their related functions.

This script step assigns the attachments you have set in the "Attachments" field. It uses the SMTP-AttachAssign function to set the attachments. The field could also be a calculation so that you can send different attachments based on the current record, or you could add a new field to your database for a Filename, and then use the SMTP-AttachAssign function with a predefined path plus the name of your file. Such a calculation might look like this:

External ("SMTP-AttachAssign", "C:\Attachments\" & Filename)

on Windows, or

External ("SMTP-AttachAssign", "Macintosh HD:Attachments:" & Filename)

on Macintosh.

This scenario would ideally let you send a different attachment to each person. Keep in mind that you can also set a default attachment in the SMTPit Configuration Dialog mentioned earlier in this documentation. Also keep in mind that the attachments you define in the Configuration Dialog will always be sent. In other words, you could have a default attachment that you send, plus an attachment specifically for each person.

The third script step is another comment telling you that the next step sends the message.

The fourth script step calls the SMTP-Send function to send the actual email. Keep a close eye on the "Result" field when you are trying to debug your scripts because it will tell you what is going wrong if the email is not sent. You can also check the "Full Result" field on the "Full Result" Layout for a more detailed log of the transaction.

The fifth script step is another comment telling you that the next step copies the SMTP-Send result to the "Full Result" field.

 

Send All - Text Script

The send all script is very simple. It first finds all of the records in your database, goes to the first record, and enters into a loop. Inside the loop, it runs the "Send Mail - Text" script on the current record and then goes to the next record. It continues this loop until it reaches the last record. If you want to send email to a found set take out the "Find All" script step, and then run the "Send All" script again. This will still run the loop, but will start with the first record in your found set and send emails for only those records in the found set.

 

Attach File Script

This script simply calls the SMTP-FileNameAcquire function, which allows you to locate a file on your hard drive that you want to attach. This function does not actually attach the file to the email, but instead returns a full path and filename to the file and places it in the "Attachment" field. When one of the "Send Mail" scripts is called, the contents of the "Attachment" field is sent to the plug-in so that it can attach the files.

Other Scripts

The example database also includes a "Send Mail - HTML" script, a "Send All - HTML" script, a "Send Mail - Text+HTML" script, and a "Send All - Text+HTML" script. These scripts are basically the same as the "Send Mail - Text" and "Send All - Text" scripts, except they assign the HTML Body of the email instead of the Plain Text Body of the email. The "Send Mail - HTML" script will send an HTML only email with the values in the database. The "Send Mail - Text+HTML" script will send a multipart/alternative Text & HTML email. The purpose of a Text & HTML email is so that if someone you are sending to does not have an HTML compliant email client, they can still receive a text message.

 

Using Inline HTML Images [Index]


One of the exciting new features in SMTPit 2.5 is the ability to not only have HTML emails, but to also include inline HTML graphics in those HTML emails. In order to use the inline HTML images within your HTML code, you will need to keep track of the order you add the HTMLImages. The first email you assign will be HTML Image number 1, the second one you assign (or append) will be HTML Image number 2, etc. (Note: If you have Default HTML Images defined in the Configuration Dialog, SMTPit will assign those HTML Images first and will number them first.) Once you have the order of the images down, then in your HTML code, you will define an image like this:

<img src="cid:part1" height=100, width=100>

The "src" parameter is the key to showing the correct images at the correct locations. The parameter must always contain "cid:part#" where "#" is the number of the HTML Image in the order that you assigned them above.

 

SMTPit External Functions Reference [Index]


SMTPit has three different types of functions that make Emailing with FileMaker more flexible and easier to use. First, there are functions that assign values. Second, there are functions that append values. Third, there are functions such as SMTP-AssignAll, SMTP-ClearAll, and SMTP-Send, which affect all Email fields. The following is a list of all available functions and a complete description of each. Note that there are several functions that can have default values set in the Configuration Dialog. See the Installation and Configuration section for a complete understanding of how the Configuration Dialog works. Functions with an asterisk ("*") are new with version 2.5.

 

SMTP-Version

This function returns the current version of SMTPit when the parameter string is empty (""). You can also use this function to display the configuration dialog. If you pass it the parameter "CONFIGURE", the configuration dialog will open. If you pass it the parameter "ABOUT", it will display the configuration dialog with the "About" tab as the first tab shown.

 

SMTP-Register

This function allows you to register your copy of SMTPit via a function rather than using the Configuration Dialog. It is mostly meant for developers so that they can register plug-ins for bound solutions. This function looks like the following:
External("SMTP-Register", "First Name|Last Name|Serial Number")

The parameter consists of your first name, last name, and serial number all separated by the pipe character ("|"). ("|" is created by typing shift-backslash.)

 

SMTP-AssignAll

Assign all Email header fields at once in the form of:
External(SMTP-AssignAll,"Host=smtp.your.com¶To=theiremail@their.com¶
From=youremail@your.com¶CC=otherpeople@their.com¶
BCC=blindcopies@their.com¶subject=your subject")

You must use SMTP-BodyAssign, SMTP-HeaderAssign, SMTP-FooterAssign, SMTP-HTMLBodyAssign, SMTP-HTMLHeaderAssign, SMTP-HTMLFooterAssign, SMTP-AttachAssign, SMTP-DlgAttachAssign, SMTP-HTMLImageAssign, SMTP-DlgHTMLImageAssign, SMTP-EmailHeaderAppend and their related append functions to set those values separately. The SMTP-AssignAll function is only for Host, To, From, CC, BCC, and Subject. Note that the Email fields can be in any order, but you must separate them with the pipe character ("|") or with the paragraph mark ("¶").

 

SMTP-ToAssign

Use the SMTP-ToAssign function to assign the "To" email header. Once assigned you can add other Email addresses by using the SMTP-ToAppend function. Note: If you use the SMTP-ToAssign function twice, the second one will overwrite the first.

 

SMTP-ToAppend

The SMTP-ToAppend function will add email addresses to the "To" email header. If you have not set an email address with SMTP-ToAssign, SMTP-ToAppend will assign the current value to the "To" field. You can use SMTP-ToAppend multiple times without overwriting previous settings, unlike the SMTP-ToAssign function.

 

SMTP-FromAssign

Use the SMTP-FromAssign function to assign the "From" email header. Note: If you use the SMTP-FromAssign function twice, the second one will overwrite the first. If you assign a "From" email address using this function, SMTPit will ignore the Default From field in the Configuration box.

 

SMTP-FromNameAssign

Use the SMTP-FromAssign function to assign the "From Name" when sending email. This is the name that will show up next to your email address when you send mail with SMTPit. You can also set a default from name in the configuration box. Note: If you use the SMTP-FromNameAssign function twice, the second one will overwrite the first. If you assign a "From Name" using this function, SMTPit will ignore the Default From Name field in the Configuration box.

 

SMTP-SubjectAssign

Use the SMTP-SubjectAssign function to assign the "Subject" email header. Note: If you use the SMTP-SubjectAssign function twice, the second will overwrite the first. If you assign a "Subject" email header with this function, SMTPit will ignore the Default Subject field in the Configuration box.

 

SMTP-SubjectAppend

The SMTP-SubjectAppend function will add to the "Subject" email header. If you have previously used the SMTP-SubjectAssign function, this function will add on to that setting. However, if you have not previously used the SMTP-SubjectAssign function, but you have a value in the "Default Subject" field in the Configuration box, this function will add to the default setting. You can use SMTP-SubjectAppend multiple times without overwriting previous assignments, unlike the SMTP-SubjectAssign function.

 

SMTP-CCAssign

Use the SMTP-CCAssign function to assign the "CC" (Carbon Copy) email header. Note: If you use the SMTP-CCAssign function twice, the second one will overwrite the first.

 

SMTP-CCAppend

The SMTP-CCAppend function will add email addresses to the "CC" email header. If you have not set an email address with SMTP-CCAssign, SMTP-CCAppend will assign the current value to the "CC" field. You can use SMTP-CCAppend multiple times without overwriting previous settings, unlike the SMTP-CCAssign function.

 

SMTP-BCCAssign

Use the SMTP-BCCAssign function to assign the "BCC" (Blind Carbon Copy) email header. Note: If you use the SMTP-BCCAssign function twice, the second one will overwrite the first.

 

SMTP-BCCAppend

The SMTP-BCCAppend function will add email addresses to the "BCC" email header. If you have not set an email address with SMTP-BCCAssign, SMTP-BCCAppend will assign the current value to the "BCC" field. You can use SMTP-BCCAppend multiple times without overwriting previous settings, unlike the SMTP-BCCAssign function.

 

SMTP-BodyAssign

Use the SMTP-BodyAssign function to assign the Plain Text Body of the email. Note: If you use the SMTP-BodyAssign function twice, the second one will overwrite the first.

 

SMTP-BodyAppend

The SMTP-BodyAppend function will add to the Plain Text Body of the email assigned by SMTP-BodyAssign. If you have not set a body with SMTP-BodyAssign, SMTP-BodyAppend will assign the current value to the "Body" of the email. You can use SMTP-BodyAppend multiple times without overwriting previous settings, unlike the SMTP-BodyAppend function.

 

SMTP-FileBodyAssign*

You can use the SMTP-FileBodyAssign function to load a text file into the Plain Text Body of the email. Note: If you use SMTP-BodyAssign or SMTP-FileBodyAssign a second time, it will overwrite the previous setting.

 

SMTP-FileBodyAppend*

The SMTP-FileBodyAppend function will add the contents of a text file to the Plain Text Body of the email. You can use this function several times to add different text files to the Plain Text Body without overwriting any previous settings.

 

SMTP-HTMLBodyAssign*

This function works exactly like the SMTP-BodyAssign function, except that it sets the HTML Body of the email instead of the Plain Text Body of the email. Note: If you use this function twice, the second one will overwrite the first.

 

SMTP-HTMLBodyAppend*

This function works exactly like the SMTP-BodyAppend function, except that it appends to the HTML Body of the email instead of the Plain Text Body of the email. You can use this function multiple times to append more HTML text.

 

SMTP-HTMLFileBodyAssign*

This function works exactly like the SMTP-FileBodyAssign function, except that it sets the HTML Body of the email isntead of the Plain Text Body of the email. Note: If you use SMTP-HTMLBodyAssign, or SMTP-HTMLFileBodyAssign a second time, it will overwrite the previous setting.

 

SMTP-HTMLFileBodyAppend*

This function works exactly like the SMTP-FileBodyAppend function, except that it appends to the HTML Body of the email instead of the Plain Text Body of the email. You can use this function several times to add different HTML files to the HTML Body without overwriting any previous settings.

 

SMTP-Send

The SMTP-Send function first checks to make sure you have assigned enough fields to send an email. If everything checks out, it attempts to send the email to your mail server. If there is a problem sending the email to your mail server, it will return the error. If the email sent successfully, it will return the string "Email Sent Successfully." You should set he parameter to the empty string (""). Note: Unlike previous versions, the SMTP-Send function now waits until the email has been successfully sent to your mail server before returning to FileMaker. This obsoletes the SMTP-SendWait function.

 

SMTP-ClearAll

The SMTP-ClearAll function clears all fields so that the next email can start with a clean slate. You can also set SMTPit to automatically clear or not clear specific fields on the "After Send" tab in the Configuration box.

 

SMTP-HostAssign

The SMTP-HostAssign is key in the emailing process. You can assign the host for each email, or set up a Default Host in the Configuration box. SMTP-Send and SMTP-SendWait will return an error if no host has been set. If you assign a host with this function, SMTPit will ignore the Default Host in the configuration box.

 

SMTP-HeaderAssign

This is a unique function that will allow you to have a Body Header in the Plain Text Body of your email message. Possible uses are email letterheads or personalized email messages for mass emailing. SMTPit also allows you to set a Default Header in the Configuration Dialog. If you assign a Plain Text Header using SMTP-HeaderAssign, SMTPit will ignore the Default Header.

 

SMTP-HeaderAppend

The SMTP-HeaderAppend will append text to the current Plain Text Body Header. If you have not previously used the SMTP-HeaderAssign function, but you have a Default Header defined in the Configuration Dialog, this function will append to the Default Header.

 

SMTP-HTMLHeaderAssign*

This function works exactly like the SMTP-HeaderAssign function, except that it sets the HTML Body Header instead of the Plain Text Body Header. You can also assign a Default HTML Header in the Configuration Dialog. If you assign an HTML Header using SMTP-HTMLHeaderAssign, SMTPit will ignore the Default HTML Header.

 

SMTP-HTMLHeaderAppend*

This function works exactly like the SMTP-HeaderAppend function, except that it appends to the HTML Body Header instead of the Plain Text Body Header. If you have not previously used the SMTP-HTMLHeaderAssign function, but you have a Default HTML Header in the Configuration Dialog, this function will append to the Default HTML Header.

 

SMTP-FooterAssign

This is another unique function in SMTPit that will allow you to have a Body Footer in the body of your email message. Possible uses include an email signature, a public key, an email advertisement, quotes, or a passage telling how to unsubscribe from your list. You can set a Default Footer in the Configuration Dialog. If you assign a Plain Text Footer using SMTP-FooterAssign, SMTPit will ignore the default footer.

 

SMTP-FooterAppend

Like the SMTP-HeaderAppend, the SMTP-FooterAppend appends text to the current Body Footer. If you have not previously used the SMTP-FooterAssign function, but you have a Default Footer defined in the Configuration Dialog, this function will append to the Default Footer.

 

SMTP-HTMLFooterAssign*

This function works exactly like the SMTP-FooterAssign function, except that it sets the HTML Body Footer instead of the Plain Text Body Footer. You can also assign a Default HTML Footer in the Configuration Dialog. If you assign an HTML Footer using the SMTP-HTMLFooterAssign, SMTPit will ignore the Default HTML Footer.

 

SMTP-HTMLFooterAppend*

This function works exactly like the SMTP-FooterAppend function, except that it appends to the HTML Body Footer instead of the Plain Text Body Footer. If you have not previously used the SMTP-HTMLFooterAssign function, but you have a Default HTML Footer in the Configuration Dialog, this function will append to the Default HTML Footer.

 

SMTP-AttachAssign

The SMTP-AttachAssign function allows you to attach a file on your hard drive or network to the current email being sent. You must specify the full path and filename to the file. Note: If you use the SMTP-AttachAssign function twice, the second one will overwrite the first. If you assign an attachment using this function, SMTPit will ignore the Default Attachments set in the Configuration box.

 

SMTP-DlgAttachAssign

This function lets you choose a file from your hard drive to be attached to the current email being sent. It uses a standard dialog box that allows you to navigate to your desired file. The parameter should be set to the empty string (""). If you assign an attachment using this function, SMTPit will ignore the Default Attachments set in the Configuration box.

 

SMTP-AttachAppend

The SMTP-AttachAppend function works exactly like the SMTP-AttachAssign function except that it adds attachments to your current attachments list. If you have not previously used the SMTP-AttachAssign or SMTP-DlgAttachAssign functions to assign attachments, but you have Default Attachments defined in the Configuration box, this function will append to the Default Attachments list.

 

SMTP-DlgAttachAppend

The SMTP-DlgAttachAppend function works exactly like the SMTP-DlgAttachAssign function except that it adds attachments to your current attachments list. If you have not previously used the SMTP-AttachAssign or SMTP-DlgAttachAssign functions to assign attachments, but you have Default Attachments defined in the Configuration box, this function will append to the Default Attachments list.

 

SMTP-HTMLImageAssign*

The SMTP-HTMLImageAssign function is similar to the SMTP-AttachAssign function. This function allows you to attach a graphic image file on your hard drive or network to the current email being sent. SMTPit takes this graphic and makes it an inline graphic image for you to use in your HTML Emails. You must specify the full path and filename of the image. You can assign more than one file with this function by separating the file names with the paragraph mark (or one per line). If you have HTML Images assigned in the Configuration Dialog, they will always be sent with your email, and they will be added to the email first. For more information on inline HTML images, see "Using Inline HTML Images" earlier in this documentation.

 

SMTP-DlgHTMLImageAssign*

The SMTP-DlgHTMLImageAssign function is similar to the SMTP-DlgAttachAssign function. This function lets you choose a graphic image file from your hard drive and attaches it to the current email. For more information on inline HTML images, see "Using Inline HTML Images" earlier in this documentation.

 

SMTP-HTMLImageAppend*

The SMTP-HTMLImageAppend function is similar to the SMTP-AttachAppend function. This function will add more graphic images files to your current list of HTML Images. You can append more than one file with this function by separating the file names with the paragraph mark (or one per line). For more information on inline HTML images, see "Using Inline HTML Images" earlier in this documentation

 

SMTP-DlgHTMLImageAppend*

The SMTP-DlgHTMLImageAppend function is similar to the SMTP-DlgAttachAppend funtion. This function lets you choose a graphic image file on your hard drive and adds it to your current list of HTML Images. For more information on inline HTML images, see "Using Inline HTML Images" earlier in this documentation.

 

SMTP-EmailHeaderAppend

The SMTP-EmailHeaderAppend adds extra email headers to your email messages. Note that there should be no spaces in the name section of the header, however the value can have spaces. This function looks like the following:
External ("SMTP-EmailHeaderAppend", "name=email header value")

The first part is the name and the second part is the value corresponding to the name part. Use an equal sign to separate them. Note that you can also set Default Email Headers in the Configuration box.

 

SMTP-FileNameAcquire

This function allows you to use a dialog box to navigate to a desired file, and then returns the full path and filename of the select file. Note: SMTP-FileNameAcquire only returns a valid path. It does not use the selected file as an attachment.

 

SMTP-PriorityAssign*

This function allows you to set the "Priority" of an email. Most Email clients understand the Priority setting on an email and will highlight the email as more or less important than other emails. This function will take the numbers 1 through 5 with 1 being the Highest Priority, and 5 being the Lowest. This function will also take one of the following five words: "Highest", "High", "Normal", "Low", or "Lowest". The Priority defaults to "Normal".

 

Obsolete Functions

SMTP-SendWait

The SMTP-SendWait function does the exact same as the SMTP-Send function, except that it waits for the sending to complete before returning to FileMaker and continuing your script. The parameter should be set to the empty string ("").

 

 

Understanding Error Responses [Index]


Every function in SMTPit returns a response indicating the success or failure of that function. If the function is successful, it will return a response indicating that it set the value you were trying to set, or completed the task that needed to be completed. If however, the function is not successful, it will return an Error Response. This Error Response is in the form of:

ERROR: <Function Name>: <Error Description>

For example, if you forgot to set a From Address using SMTP-FromAssign, and you attempt to send the email using SMTP-Send, the Send function will return the following Error Response:

ERROR: Send: Missing From

Error responses always start with the word "ERROR" in all caps, followed by a colon, followed by the function that had the error, followed by a colon, followed by the actual error that occurred. You can use the various FileMaker Text Functions to extract the different parts of the Error Response for your own use.

 

Credits [Index]


Programming and documentation by Jake Traynham
Concept, web design, and documentation by Jesse Traynham

Contact Information [Index]


Email: SMTPit@comm-unity.net
SMTPit Website: http://www.smtpit.com
Main Website: http://www.filemaker.comm-unity.net
Phone: 817-560-4226

You can write us at

Comm-Unity Networking Systems
8652 Hwy 80 West
Fort Worth, Texas 76116