SoftadminApi.Mail_Enqueue

Type: Stored procedure

Inserts an email into the system's internal mail queue.

The procedure accepts a few optional temporary tables:

CREATE TABLE #To
(
  [Address] nvarchar(max) NOT NULL
)

CREATE TABLE #Bcc
(
  [Address] nvarchar(max) NOT NULL
)

CREATE TABLE #Attachment
(
  [Filename] varchar(300) NOT NULL,
  [File] varbinary(max) NOT NULL,
  [ContentId] varchar(300) NULL
)

Parameters

@Css optional varchar
For an HTML mail, extra style declarations that should be included in the mail. You must wrap the CSS in a <style>-tag.
@EmailIdOut optional bigint
ID of the queued email. You can use it to lookup the message in the SoftadminApi.MailQueue view.
@FromAddress mandatory nvarchar
The from address.
@FromName optional nvarchar
Human-readable version of the sender's name.
@HtmlBody optional varchar
The body of an HTML mail. You must specify at least one of @HtmlBody and @PlaintextBody.
@ListUnsubscribe optional nvarchar(600)
Sets the List-unsubscribe header. See email component for full description.
@PlaintextBody optional varchar
The body of a plaintext mail. You must specify at least one of @HtmlBody and @PlaintextBody.
@ReplyAddress optional nvarchar
Alternate reply-address.
@Subject mandatory varchar
Email subject line.
@ToAddress optional nvarchar
Receiver, if you do not use the #To table. If the #To table is present then the union of this parameter and the table are used.