Skip to content

Flow documentation · legacy product

SendEmailExBCC ​

(Not available before Flow version 2.30m)

Declaration ​

function SendEmailExBCC (const aSubject, aMessage, aMessageHTML, aTo, aFrom, aFromName : string; aRaiseError, aSMTPValidateEmail: boolean; aToBCC : string) : boolean;

Description ​

Sends an email to the aTo email address(es), and/or to the aToBCC email address(es), with aSubject as the subject line and aMessage as the body of the email. In addition, an HTML body can be specified and other parameters can be used.

The SendEmailEx function has the following parameters:

  • aSubject (string): Message subject
  • aMessage (string): Text version of the message
  • aMessageHTML (string): HTML version of the message
  • aTo (string): Recipient(s) for this message. Multiple email addresses can be included by separating them with commas within the string
  • aFrom (string): The sender e-mail address for the message
  • aFromName (string): The sender name for the message
  • aRaiseError: Indicates whether SendEmailEx will raise an exception within the script (if True) or trigger an error status for the Action (if False) - see notes below
  • aSMTPValidateEmail: indicates whether SMTP component will handle malformed email error messages
  • aToBCC (string): BCC (blind carbon copy, i.e. undisclosed) recipient(s) for this message. Multiple email addresses can be included by separating them with commas within the string

aRaiseError parameter: When this parameter is False, any email error messages from this function are logged by Flow and will put the action in an Error state and the Action will stop running. When this parameter is True, email error messages are NOT logged by Flow and the Action will continue running. You can use a try..except block to manage any error messages. See example below.

Example ​

pascal
procedure ScriptEvent (var Value : variant);
var
emails: array[0..3] of string;
i: Integer;
begin
emails[0] := 'valid@email.com';
emails[1] := 'invalid_email@yourdomain.co.nz';
emails[2] := 'malformed_email';
emails[3] := 'valid@email.com';
for i := 0 to 3 do begin
try
LogInfo('Sending email to ' + emails[i]);
SendEmailExBCC('Flow Test', 'Hello', '<html><body> <b>Hello</b> </body> </html>', emails[i], 'your_email@yourdomain.co.nz', 'Flow Software', True, True, 'bcc_email@yourdomain.co.nz');
except
LogInfo('*** Error sending email to ' + emails[i] + ' - Error message: ' + ExceptionToString(ExceptionType, ExceptionParam));
end; // end "try"
end; // end "for"
end;