smtp_email_send()

Send an email through a configured SMTP integration connection. This is a plain send — to log the email on a record's thread and let replies thread back, use record_email_send() instead.

Syntax

smtp_email_send(connection, spec)

Parameters

Name Type Required Description
connection string yes Name of the SMTP integration connection.
spec array yes The email (see keys below).

spec keys: to (string or list), cc?, bcc?, subject, html (body), from? ("Name <email>"; defaults to the connection's sender identity).

Returns

The delivery result from the SMTP integration.

Example

smtp_email_send("Main SMTP", [
    "to"      => $record["email"],
    "subject" => "Welcome, " . $record["name"],
    "html"    => "<p>Thanks for signing up!</p>"
]);

Example output

["sent" => true, "messageId" => "<...@infolobby>"]

Notes

  • Set up the SMTP connection under your account's integrations first.
  • from must be one of the connection's configured sender identities, or leave it out to use the default.

See also: record_email_send(), Integrations