Class DatabaseMailSchema.UnsentItem
- Namespace
- LinqToDB.Tools.DataProvider.SqlServer.Schemas
- Assembly
- linq2db.Tools.dll
sysmail_unsentitems (Transact-SQL)
Applies to: √ SQL Server (all supported versions) √ Azure SQL Managed Instance
Contains one row for each Database Mail message with the unsent or retrying status. Messages with unsent or retrying status are still in the mail queue and may be sent at any time. Messages can have the unsent status for the following reasons:
- The message is new, and though the message has been placed on the mail queue, Database Mail is working on other messages and has not yet reached this message.
- The Database Mail external program is not running and no mail is being sent.
Messages can have the retrying status for the following reasons:
- Database Mail has attempted to send the mail, but the SMTP mail server could not be contacted. Database Mail will continue to attempt to send the message using other Database Mail accounts assigned to the profile that sent the message. If no accounts can send the mail, Database Mail will wait for the length of time configured for the Account Retry Delay parameter and then attempt to send the message again. Database Mail uses the Account Retry Attempts parameter to determine how many times to attempt to send the message. Messages retain retrying status as long as Database Mail is attempting to send the message.
Use this view when you want to see how many messages are waiting to be sent and how long they have been in the mail queue. Normally the number of unsent messages will be low. Conduct a benchmark test during normal operations to determine a reasonable number of messages in the message queue for your operations.
To see all messages processed by Database Mail, use sysmail_allitems (Transact-SQL). To see only messages with the failed status, use sysmail_faileditems (Transact-SQL). To see only messages that were sent, use sysmail_sentitems (Transact-SQL).
[Table(Database = "msdb", Schema = "dbo", Name = "sysmail_unsentitems", IsView = true)]
public class DatabaseMailSchema.UnsentItem
- Inheritance
-
DatabaseMailSchema.UnsentItem
- Extension Methods
Properties
AppendQueryError
The append_query_error parameter of the message. 0 indicates that Database Mail should not send the e-mail message if there is an error in the query.
[Column("append_query_error")]
[NotNull]
public bool AppendQueryError { get; set; }
Property Value
AttachQueryResultAsFile
When the value is 0, the query results were included in the body of the e-mail message, after the contents of the body. When the value is 1, the results were returned as an attachment.
[Column("attach_query_result_as_file")]
[NotNull]
public bool AttachQueryResultAsFile { get; set; }
Property Value
AttachmentEncoding
The type of mail attachment.
[Column("attachment_encoding")]
[NotNull]
public string AttachmentEncoding { get; set; }
Property Value
BlindCopyRecipients
The e-mail addresses of those who receive copies of the message but whose names do not appear in the message header.
[Column("blind_copy_recipients")]
[NotNull]
public string BlindCopyRecipients { get; set; }
Property Value
Body
The body of the message.
[Column("body")]
[NotNull]
public string Body { get; set; }
Property Value
BodyFormat
The body format of the message. The possible values are TEXT and HTML.
[Column("body_format")]
[NotNull]
public string BodyFormat { get; set; }
Property Value
CopyRecipients
The e-mail addresses of those who receive copies of the message.
[Column("copy_recipients")]
[NotNull]
public string CopyRecipients { get; set; }
Property Value
ExcludeQueryOutput
The exclude_query_output parameter of the message. For more information, see sp_send_dbmail (Transact-SQL).
[Column("exclude_query_output")]
[NotNull]
public bool ExcludeQueryOutput { get; set; }
Property Value
ExecuteQueryDatabase
The database context within which the mail program executed the query.
[Column("execute_query_database")]
[NotNull]
public string ExecuteQueryDatabase { get; set; }
Property Value
FileAttachments
A semicolon-delimited list of file names attached to the e-mail message.
[Column("file_attachments")]
[NotNull]
public string FileAttachments { get; set; }
Property Value
Importance
The importance parameter of the message.
[Column("importance")]
[NotNull]
public string Importance { get; set; }
Property Value
LastModDate
The date and time of the last modification of the row.
[Column("last_mod_date")]
[NotNull]
public DateTime LastModDate { get; set; }
Property Value
LastModUser
The user who last modified the row.
[Column("last_mod_user")]
[NotNull]
public string LastModUser { get; set; }
Property Value
MailItemID
Identifier of the mail item in the mail queue.
[Column("mailitem_id")]
[NotNull]
public int MailItemID { get; set; }
Property Value
ProfileID
The identifier of the profile used to submit the message.
[Column("profile_id")]
[NotNull]
public int ProfileID { get; set; }
Property Value
Query
The query executed by the mail program.
[Column("query")]
[NotNull]
public string Query { get; set; }
Property Value
QueryResultHeader
When the value is 1, query results contained column headers. When the value is 0, query results did not include column headers.
[Column("query_result_header")]
[NotNull]
public bool QueryResultHeader { get; set; }
Property Value
QueryResultSeparator
The character used to separate columns in the query output.
[Column("query_result_separator")]
[NotNull]
public string QueryResultSeparator { get; set; }
Property Value
QueryResultWidth
The query_result_width parameter of the message.
[Column("query_result_width")]
[NotNull]
public int QueryResultWidth { get; set; }
Property Value
Recipients
The e-mail addresses of the message recipients.
[Column("recipients")]
[NotNull]
public string Recipients { get; set; }
Property Value
SendRequestDate
The date and time the message was placed on the mail queue.
[Column("send_request_date")]
[NotNull]
public DateTime SendRequestDate { get; set; }
Property Value
SendRequestUser
The user who submitted the message. This is the user context of the database mail procedure, not the From field of the message.
[Column("send_request_user")]
[NotNull]
public string SendRequestUser { get; set; }
Property Value
Sensitivity
The sensitivity parameter of the message.
[Column("sensitivity")]
[NotNull]
public string Sensitivity { get; set; }
Property Value
SentAccountID
The identifier of the Database Mail account used to send the message. Always NULL for this view.
[Column("sent_account_id")]
[NotNull]
public int SentAccountID { get; set; }
Property Value
SentDate
The date and time the Database Mail last attempted to send the mail. NULL if Database Mail has not attempted to send the message.
[Column("sent_date")]
[NotNull]
public DateTime SentDate { get; set; }
Property Value
SentStatus
Will be unsent if Database Mail has not attempted to send the mail. Will be retrying if Database Mail failed to send the message but is trying again.
[Column("sent_status")]
[NotNull]
public string SentStatus { get; set; }
Property Value
Subject
The subject line of the message.
[Column("subject")]
[NotNull]
public string Subject { get; set; }