Send Email

From PresenceWiki
Jump to: navigation, search

Send Email Node

This Node is useful for sending emails over SMTP. It allows for HTML content, attachments and multiple static or dynamic recipients.

Send email dialog.png

Recipients

There are three options for adding recipients:

  • Single Recipients Click the left button to view a pop-up window with all available contacts. Drag contacts from this window into the Recipients list.
  • Group Recipients Click the second button to view a pop-up window of recipient groups. Drag groups into the Recipients list to add them.
  • Dynamic Recipients Useful if the email address or name is populated from a database. Click the third button to launch the Dynamic Recipients dialog, which allows you to enter the name and email address or Presence variable or column name referring to them.

Three Recipient Lists are stored:

  • To These are addresses that will appear in the "To" header of the email.
  • CC These are addresses that will appear in the "CC" header of the email.
  • BCC These are blind copies - recipients added to this list will receive the email but their names and addresses will not appear anywhere on the email to other recipients.

To remove a recipient click the small trash-can icon (the fourth button under the Recipients list).

Email Contents

  • Subject: This is the subject line of the email.
  • Content Body: This is the body of the email. By default emails will be sent as plain text, however you can also enter HTML here - if you use HTML ensure that the Body content type is set to "HTML Text".
  • Body Content Type: This can be Plain Text or HTML text - see above.
  • Attachments: This lets you add attachments to the email. Click the "New" icon to add an attachment. When prompted for the file location, you can enter a dynamic reference - e.g. :var{ATTACHMENT_LOCATION}. If there are multiple values for the dynamic reference then multiple attachments will be added.

SMTP Server

Select an SMTP Server resource from the dropdown tree. This is the server that Presence will attempt to connect to in order to send this email. If Presence is unable to connect to this mail server it may try others.

Miscellaneous Options

Send an individual email to each 'TO' recipient.

In the case of multiple 'TO' recipients (whether multiple recipients have been added or a dynamic column reference is used to create multiple recipients), usually one email is sent to all 'TO' recipients. This is the same as if you send one email from Outlook with multiple 'To' recipients. If this is checked, Presence will instead send a separate email to each address.

Reply-To Address

This is the address that will appear as the "reply-to" for the email. When the recipient hits "reply" to the email the reply will be sent to this address.

Email Priority

This can be High, Medium or Low. How this is interpreted is dependent on the mail server. For example Lotus Notes will delay sending low priority messages.

When should emails be sent?

  • At Earliest Opportunity Emails will be added to the mail queue for immediate delivery as soon as the Node processes the individual emails. The Task will not wait until the emails are sent.
  • Immediately Task execution will be suspended until all emails have been successfully sent.
  • Only on successful Task completion Email delivery will be suspended until the entire Task has completed without errors. If any errors are encountered emails will not be sent.

Mail Queue Structure

Pending Folders

Presence uses a file-based queuing system for sending emails. Each email is stored as a text file with an extension of ".eml" - you can open and view the emails using a mail client such as Outlook or Thunderbird. When emails are generated they are first placed in a "pending" directory which is located at:

[PRESENCE_HOME]/res/queue/mail/pending/

Each SMTP Server resource will have its own subdirectory within the pending directory.

Sent Folders

After an email is successfully sent it is moved to a subdirectory of the "sent" directory, located at:

[PRESENCE_HOME]/res/queue/mail/sent/

The sent subdirectories are named according to the date on which the emails contained were sent, first the year then the month and finally the day. So an email sent on the 25th August 2010 would be archives to a directory called:

[PRESENCE_HOME]/res/queue/mail/sent/2010/August/25/

Presence will auto-archive emails over a certain age and store them in a zip archive corresponding to the day, month or year they were sent (depending on the amount of time elapsed since they were sent).

Failed Folder

If Presence is unable to send an email - perhaps because it cannot contact the SMTP server or the SMTP server cannot relay the email - it will first attempt to retry it using a different SMTP Server. The SMTP Server chosen depends on the priority assigned to the resource. If there are no more SMTP Servers to try the mail file will be moved a subdirectory of the "failed" directory - located at:

[PRESENCE_HOME]/res/queue/mail/failed/

The "failed" subdirectories use the same naming convention as the "sent" subdirectories - i.e. year/month/day. Once you have established the reason for the email(s) failing you can just drag them into the relevant "pending" directory to have Presence resend them.

See Also

Task Elements : Action Task Elements : Send Email

Send Email | Send SMS | Send Fax | Broadcast Messages
Read Text File | Read Binary File | Write Text File | Write Binary File | Parse File Action
Rename File | Copy File | Delete File | Parse File Action
Generate Bar Code | Read Bar Code
Dynamic Task Call | Call Native Program | FTP Upload | Scorecard Collector | Create Graph | AS400 Action
Socket Client Action | Socket Server Action
JMS Producer | JMS Consumer


Task Elements | Resources