Universal Email adds email functionality to your page. You may want to email the contents of a form when the form is submitted or you might have a newsletter that you want to email to your customer list.
This tutorial will guide you through applying Universal Email to a form, so that the contents entered into the form will be included in the email. In addition, we will discuss two of the most useful new features of Universal Email 4, File Manipulation and Email Delay for mass mailing.
You will need the following items before starting this tutorial:
- Universal Email 4
- Dreamweaver CS3 or later
- Dreamweaver site defined
- PHP page open in Dreamweaver
If a page is not open in Dreamweaver, the access point to launch Universal Email will be disabled.
- Optional: A connection to a MySQL database
Required for email logging or sending emails from a recordset or database.
If you want to have a form that can be completed online and when submitted will email the entered contents, you will first need to create a PHP page with the appropriate form fields and elements. Any PHP page with standard form fields will work, but for a more fully-featured form, you can use CSS Form Builder and create any form type you desire.
Once you have created your form and are ready to apply Universal Email, make sure your site is defined properly in the Dreamweaver Files Panel, then open the PHP page that contains your form.
- From the Insert menu, choose WebAssist > Create Email Message.
From the Universal Email Quick Insert interface you can specify all the basic details for your email. Many users could simply enter the static details in the appropriate fields and click Finish to apply the necessary email behaviors to your form. However, for more custom options, continue along with this tutorial.
The following introduces the basic email settings available in the Quick Insert panel. Universal Email tries to provide a working setting by default, but you may want to change these to suit your needs.
- From the Trigger menu, choose when you want the email to be submitted.
The default option will usually work, but you could be more specific with your form and choose when your form's button is pressed.
- From the Go To Page field, enter the path or browse for a file you wish to navigate to after the email is sent.
You can leave this blank if you want to stay on the current page.
Email priority is sometimes specified to alert the recipient of the email that something is of high or low importance
- From the Toolbar, click the down arrow if you wish the email to be sent with low priority, choose the exclamation mark to set high priority.
Only one of the two priority options can be selected at a time. If you choose one when the other is already selected, it will deselect the other.
From, To, CC, and BCC addresses
The next four text fields in the interface allow you to specify who the email will be delivered to, and who it will appear to come from.
These four fields can be defined statically, or dynamically. For example, you may want this email to always contain the same address in the From field, if that is the case, you can enter a static address in the From field such as "email@example.com".
Each option has additional settings that can be exposed by clicking the button to the left of each field.
The From Field
In the From field, you can define what email address you want the email that is sent to appear to have come from. In many cases, users will enter a fake email address such as firstname.lastname@example.org to encourage recipients to not reply using that address.
- In the From text field, enter the email address you wish the email to come from.
To define a dynamic address click the value lightning bolt. For example, if you are applying Universal Email to a form, you could specify the field where the user enters their address.
The To Field
In the To field, you can specify the email address you wish the email to be sent to. This could be sent to multiple email addresses, or just a single address. Depending on your application, you will want to define static or dynamic email addresses.
- Contact Forms: For most contact forms, you will want the email to come directly to you. In this case, you would simply enter the static email address where you want to receive these emails.
- User Management: If you are sending emails to customers for user registration, email receipt, etc., you will most likely want to select the dynamic lightning bolt and choose the appropriate dynamic binding.
- Bulk Emailing: If you are planning on sending your email to a large number of recipients, you will want to configure more advanced options for sending your email. Click the To... button to the left of the To field to expose these options.
- In the To field, enter the email address or choose a dynamic option depending on your needs (see above).
Configuring the advanced To options is detailed below in the Advanced To Options section.
The CC and BCC Fields
The CC and BCC fields are not required and can be configured in very much the same manner as the To fields. However, the Advanced To field options are not available for these two fields. In most cases, when bulk emailing, you can avoid requiring the CC and BCC options by defining the Advanced To options to only send one email per recipient.
- Specify the CC and BCC fields as desired.
The To, CC and BCC fields can contain multiple static email addresses or a combination of static and dynamic addresses. If entering multiple static address, simply entering a comma (,) to separate these addresses will work.
At this point, you have given Universal Email enough information to click Finish and your email functionality will most likely work. However, you might want to add attachments, configure email logging, or email delay settings. If so, continue reading...
Including attachments with your email is very straightforward with Universal Email. You can choose to attach a static file, attach files retrieved from a Recordset, or new to Universal Email 4, allow the user to specify a file to be attached when they submit the form.
- To specify any attachments, click the Attachment icon from the toolbar.
- Click Add to specify the details for the attachment.
The Add and Delete options allow you to configure multiple attachments for the email.
- If you wish to specify a static file, simply specify the path to that file using the browse option for Enter value.
The file you specify must already be uploaded to your server in order to be attached to the email.
- If you have a recordset defined that you want to retrieve the attachments from, select the Recordset loop option and specify the database column that will contain the paths to the files.
If you want to use this feature, you will need to have configured a database connection and created the recordset prior to launching Universal Email.
- If a file field exists on your current page, you will be able to select that file field from the Submitted File option. This will allow your form user to browse for the file they want to attach to the email.
- Click OK once you have configured all your attachment settings.
The Email Logging feature allows you to store information in your database for every email that is sent. This tracks success or failure to help you determine if your emails are leaving your server correctly. Other useful information that is stored include error messages, email body, who the email sent to, and more.
To use this feature, you will need to have configured a MySQL database prior to opening Universal Email.
The Email Logging feature will not be able to determine if an email address in fact exists. It cannot record information regarding the email once it leaves your own server.
- To configure email logging, click the Email Logging button from the Toolbar.
- From the Event menu, choose when you want information stored in your database.
- On Success or Failure: Record information in the database for every email that it sent.
- On Success: Record information in the database whenever an email succeeds.
- On Failure: Record information in the database whenever an email fails.
You can specify different actions for the 3 different events. However, most users will find it easier to use On Success or Failure, and to filter the information from the database that they need.
- In the Response menu, choose what you would like to do when the specified event occurs.
- Do nothing: Will not log anything for the selected event.
- Create the Log Table For Me: Will automatically create an email_log table in your database with all the necessary bindings already created. This will insert a new record for each email address that you send an email to.
- Insert Record: Will insert a new record in your database for each email address each time you send an email, when the selected event occurs.
- Update Record: Will update the status column for each email address that you send an email to, when the selected event occurs.
For most users that want to utilize this feature, simply choosing the Create the Log Table For Me option will record all the necessary information they need, without requiring any database knowledge.
- Click OK when you are finished.
Determining the design of your email can be a challenging task. The more complex your design becomes, the less likely it will appear consistent across all email clients. Microsoft Outlook 2007 and higher uses the MS Word engine to render your emails. Therefore, you will likely want to focus on creating a more table based layout for your email, since Word does not typically render CSS/HTML as it does it modern browsers.
When using the Create a file for your email option, the webassist/email/templates folder must be uploaded manually to your site before the email body will show to users trying to view your emails.
To make the creation of the email design a less cumbersome task, Universal Email 4 includes preset email designs for you to choose from and then modify to suit your needs. These have been tested across a number of email clients and should work for most users needs.
- In the Email body section, choose the Create a file for your email checkbox.
It is recommended that you choose one of these preset designs instead of manually creating your email design from scratch. You are free to completely customize these designs from within Dreamweaver after applying Universal Email.
- If you wish to use one of the preset email designs, choose your preferred design from the list.
You can also browse to a file you wish to be emailed by choosing the browse option.
- Alternatively, you can manually create the email you wish to use by clicking the DW Edit button, or the Edit icon.
When using these options, the email content that you create will not be a separate file like it would if you selected a design preset or browsed for a file.
- When you are finished, click Finish to apply Universal Email.
Once Universal Email closes, if you chose to create a file for your email, that file will open in Dreamweaver for you to make modifications to. You can change the content of this file at any time to customize the appearance or content of the email that is sent.
The Advanced To interface includes a number of settings that are useful if your email is intended for multiple recipients. This includes the email delay option will allows you to attempt to bypass any send limits that are set by your hosting provider.
- To access this interface, click the To... button next to the To field.
- From the Send email list, choose Once Per Entry or To all entries at once.
- Once Per Entry: Will send a separate email for each recipient.
- To all entries at once: Will send one email with all recipients in the To field.
In order to use the Email Delay options, you must select Once Per Entry.
- Click Add to configure the recipient of your email.
The Add and Delete options allow you to specify multiple recipients, through multiple means. For example, you can enter a static address to be included and then click Add again to specify from file.
- From the three options available specify where the email addresses are to be retrieved, or enter a static address.
- Enter value: Allows you to enter a static email address as a recipient.
- Recordset loop: Allows you to choose a Recordset and column that contains the email addresses you wish to be emailed.
In order to use this option you must have a MySQL database connection defined, and a recordset already created on the page you are applying Universal Email to.
- From file: Allows you to browse for a file that contains email addresses. Universal Email will send the email to all correctly formatted email addresses found in that file.Any file format should work as Universal Email simply looks for email addresses among all the other data. However, we recommend CSV, XML or TXT files if you are unsure which file format to use.
In the Email Limits section, you can attempt to bypass your hosting provider's send rate limitations. If you know the specific limitations, it is easier to accurately configure these settings. Check this page for more information, or contact your hosting provider for more information.
- In the Wait field, enter how many seconds Universal Email should wait between sending emails.
- In the other two fields, specify how many emails to be sent each minute.
- When you are finished, click OK.
- Once you have completed specifying your email settings, click Finish to apply Universal Email.
If you are sending emails to a large mail list, you may find it helpful to add a progress bar to your page after applying Universal Email.
The Universal Email progress bar will display the number of emails sent and remaining, as well as the amount of seconds left until all the emails are sent.
- After applying Universal Email, from the Insert menu, choose WebAssist > Progress Bar.
- From the Category menu, choose the Universal Email option.
- Choose the Design that best suits your page.
- Click OK to apply the progress bar to your page.
Although the progress bar is useful for seeing the process for sending many emails, it is not necessary, and you can always navigate away from the page after it starts sending the emails.
If the email is not being sent to many recipients, you may never see the progress bar as it will only display for as long as it takes to send all the emails.
Universal Email 4 not only includes email functionality. It contains all the file management features found in the older Digital File Pro. For more information on using the File Manipulation features of Universal Email 4, see the following tutorial:
- Applying File Manipulation Functionality with Universal Email 4