SendEmail

Takes 10 parameters, FieldBase, From, To, Subject, Body, bMerge, AttachName, AttachPath, Slow, IfLenFld

Description:

Sends an email, optionally with a single attachment.

If bMerge is True (is not empty) then the Body text will be searched for field names surrounded by {} and where found the Field data for that Record will be substituted.

If Slow is specified, the system will pause for the given number of milliseconds between sending each email. This can be useful for spreading out large mailings to lessen the load on the email servers and help avoid spam guards.

The email server used to send the email is specified in the Setup table as Cnw.EmailHost and Cnw.EmailPort.

To render the Body as HTML just wrap the Body in html and body

If the Body parameter of SendEmail contains one or more of the following header values prior to the first double $CrLf the contents of the Body parameter will be used as is for custom email headers and the email’s body:

When using the headers and body as-is, only the following headers will be added ahead of the custom headers, pulling from the SendEmail parameters as normal.

Usage:

FieldBase, From, To, Subject, Body, bMerge, AttachName, AttachPath, Slow, IfLenFld
FieldBase, From, To, Subject, Body, bMerge, AttachName, AttachPath, Slow, [""]
[WorkWith], From, To, Subject, Body, bMerge, AttachName, AttachPath, [""], IfLenFld
[WorkWith], From, To, Subject, Body, bMerge, AttachName, AttachPath, [""], [""]
[WorkWith], From, To, Subject, Body, bMerge, [""], [""], [""], IfLenFld
[WorkWith], From, To, Subject, Body, bMerge, [""], [""], [""], [""]
[WorkWith], From, To, Subject, Body, ["y"], [""], [""], [""], [""]
FieldBase, From, To, Subject, Body, bMerge, AttachName, AttachPath, Slow, [WorkIf]
FieldBase, From, To, Subject, Body, bMerge, AttachName, AttachPath, [""], [WorkIf]
[WorkWith], From, To, Subject, Body, bMerge, AttachName, AttachPath, [""], [WorkIf]
FieldBase, From, To, Subject, Body, bMerge, AttachName, AttachPath, [""], [WorkIf]
[WorkWith], From, To, Subject, Body, bMerge, [""], [""], [""], [WorkIf]
[WorkWith], From, To, Subject, Body, ["y"], [""], [""], [""], [WorkIf]