Lasso Soft Inc. > Home

[Email_Send]

[Email_Send] queues an email message for sending. The email message is sent within a couple minutes by an automatic background process.

The current Email Queue can be viewed in Lasso Administration in the Monitor > Email section. Preferences can also be set here for whether emails should be logged, how many retries should be attempted per email, default host, and more.

The email tag requires that the -From and -Subject parameters have values. Either the -Body or -HTML parameter should also be specified. The -Body parameter will generate a plain text email. The -HTML parameter will generate an HTML email. Specifying both will send a multi-part/alternative email.

At least one of -To, -CC, and -BCC must contain valid email addresses. Multiple email addresses can be specified separated by commas, but use of the real name and email address is not supported.

The -Host parameter is required only if a default has not been established in Lasso Administration. If a -Username and -Password are specified they will be used for SMTP AUTH authorization at the specified host. The -Username, -Password, -Timeout, and -Port parameters will only be used if a -Host parameter is specified as well.

The optional -Attachments parameter can be set to the file path for a single file that should be included as an attachment to the email message or to an array of file paths. The attached file(s) should be within the Web server root and the path(s) should be specified relative to the current page or to the Web server root.

The optional -ExtraMIMEHeaders parameter can be set to an array of name/value pairs which define extra headers that should be included with the email message. For example, a "Reply To" header could be included in this way.

  • Syntax
  • Parameters
[Email_Send: -Host='Host Name',
  -To='Recipient Email Address',
  -From='Sender Email Address',
  -Subject='Email Subject',
  -Body='Email Body Text']

[Email_Send: -Host='Host Name',
  -To='Recipient Email Address',
  -CC='Recipient Email Address',
  -BCC='Recipient Email Address',
  -From='Sender Email Address',
  -Subject='Email Subject',
  -Body='Email Body Text']

[Email_Send: -Host='Host Name',
  -To='Recipient Email Address',
  -From='Sender Email Address',
  -Subject='Email Subject',
  -Body='Email Body Text',
  -Attachments='Attachment Path',
  -ExtraMIMEHeaders='Headers Pair Array']
Required Parameters
-Host The name of the SMTP server which should be used for outgoing email.
-From The address of the sender of the message. The sender must have permission to send messages through the specified SMTP server.
-Subject The subject of the email message.
Optional Parameters
-To The address of the recipient of the message. Multiple recipients can be specified by separating the addresses with a comma. Either -To, -CC, or -BCC must be specified.
-Body The body of the email message. Either a -Body parameter or an -HTML parameter should be specified.
-CC The address of the carbon copied recipient of the message. Multiple recipients can be specified by separating the addresses with a comma. Either -To, -CC, or -BCC must be specified.
-BCC The address of the blind carbon copied recipient of the message. Multiple recipients can be specified by separating the addresses with a comma. Either -To, -CC, or -BCC must be specified.
-ExtraMIMEHeaders An array of pairs which define additional MIME headers that should be included in an outgoing email message.
-Attachments Allows a file to be attached to an email message. Accepts either a file path, a pair including a synthetic file name and the raw data of the file, or an array of file names and pairs.
-Username Optional SMTP AUTH username. If specified a -Password is required.
-Password Optional SMTP AUTH password. If specified a -Username is required.
-Priority A value of High will cause the email to be inserted into the start of the email queue. A value of Low will cause the email to be inserted into the end of the email queue.
-ReplyTo Adds a reply-to header to the email message with the specified address.
-HTML The HTML body of an email message. Either a -Body parameter or an -HTML parameter should be specified.
-ContentType Alters the content type of the email message. Normally, the content type is handled automatically so this parameter should only be used if necessary.
-CharacterSet Alters the character set of the sent email. Normally the character set is handled automatically so this parameter should only be used if necessary.
-TransferEncoding Alters the transfer encoding of the email message. Normally the transfer encoding is handled automatically so this parameter should only be used if necessary.
-ContentDisposition Alters the content disposition of the email message. Normally the content disposition is handled automatically so this parameter should only be used if necessary.
-Sender Adds a sender header to the outgoing email.
-SimpleForm Sends the current action parameters as the body of the email message. The formated parameters are sent in place of the body. This parameter can be used to quickly send emails to site administrators.
-HeaderType Sets the header type to quoted-printable "Q" encoding or base64 "B" encoding. The value should be either "Q" (the default) or "B".
-HTMLImages Allows an HTML image to be embedded in the HTML part of an email message. Accepts either a file path, a pair including a synthetic file name and the raw data of the image, or an array of file names and pairs.
-Immediate If specified then the message is sent immediately without being added to the email queue.
-Date Optional -Date parameter specifies when the email will be sent. If the date is in the past then the email will be sent immediately. Must be passed a date object.
Examples

To send an email from a format file:

Use the [Email_Send] tag. The following example sends an email to administrator@example.com through the server mail.example.com each time the page is visited. The contents of the email is the current date and time.

[Email_Send: -Host='mail.example.com',
  -To='administrator@example.com',
  -From='administrator@example.com',
  -Subject='A page visit!',
  -Body=(Date_GetCurrentDate)]

To send an email with the contents of a format file:

Use the [Email_Send] tag. The following example sends an email to administrator@example.com through the server mail.example.com each time the page is visited. The contents of the format file format.lasso is used as the body of the email message.

[Email_Send: -Host='mail.example.com',
  -To='administrator@example.com',
  -From='administrator@example.com',
  -Subject='A page visit!',
  -Body=(Include: 'format.lasso')]
Tag Link [Email_Send] Category Email
Type Process Data Source Any
Support Preferred Version 5.0
Output Type None Security Tag
Implementation LDML Sets Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0, Lasso 5.0

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft