Class DatabaseMailSchema.DataContext
- Namespace
- LinqToDB.Tools.DataProvider.SqlServer.Schemas
- Assembly
- linq2db.Tools.dll
public class DatabaseMailSchema.DataContext
- Inheritance
-
DatabaseMailSchema.DataContext
- Extension Methods
Constructors
DataContext(IDataContext)
public DataContext(IDataContext dataContext)
Parameters
dataContext
IDataContext
Properties
AllItems
sysmail_allitems (Transact-SQL)
Applies to: √ SQL Server (all supported versions) √ Azure SQL Managed Instance
Contains one row for each message processed by Database Mail. Use this view when you want to see the status of all messages.
To see only messages with the failed status, use sysmail_faileditems (Transact-SQL). To see only unsent messages, use sysmail_unsentitems (Transact-SQL). To see only messages that were sent, use sysmail_sentitems (Transact-SQL).
See dbo.sysmail_allitems.
public ITable<DatabaseMailSchema.AllItem> AllItems { get; }
Property Value
EventLogs
sysmail_event_log (Transact-SQL)
Applies to: √ SQL Server (all supported versions)
Contains one row for each Windows or SQL Server message returned by the Database Mail system. (Message in this context refers to a message such as an error message, not an e-mail message.) Configure the Logging Level parameter by using the Configure System Parameters dialog box of the Database Mail Configuration Wizard, or the sysmail_configure_sp stored procedure, to determine which messages are returned.
public ITable<DatabaseMailSchema.EventLog> EventLogs { get; }
Property Value
FailedItems
sysmail_faileditems (Transact-SQL)
Applies to: √ SQL Server (all supported versions)
Contains one row for each Database Mail message with the failed status. Use this view to determine which messages were not successfully sent.
To see all messages processed by Database Mail, use sysmail_allitems (Transact-SQL). To see only unsent messages, use sysmail_unsentitems (Transact-SQL). To see only messages that were sent, use sysmail_sentitems (Transact-SQL). To view e-mail attachments, use sysmail_mailattachments (Transact-SQL).
public ITable<DatabaseMailSchema.FailedItem> FailedItems { get; }
Property Value
MailAttachments
sysmail_mailattachments (Transact-SQL)
Applies to: √ SQL Server (all supported versions)
Contains one row for each attachment submitted to Database Mail. Use this view when you want information about Database Mail attachments. To review all e-mails processed by Database Mail use sysmail_allitems (Transact-SQL).
public ITable<DatabaseMailSchema.MailAttachment> MailAttachments { get; }
Property Value
SentItems
sysmail_sentitems (Transact-SQL)
Applies to: √ SQL Server (all supported versions) √ Azure SQL Managed Instance
Contains one row for each message sent by Database Mail. Use sysmail_sentitems when you want to see which messages were successfully sent.
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 unsent or retrying messages, use sysmail_unsentitems (Transact-SQL). To see e-mail attachments, use sysmail_mailattachments (Transact-SQL).
public ITable<DatabaseMailSchema.SentItem> SentItems { get; }
Property Value
UnsentItems
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).
public ITable<DatabaseMailSchema.UnsentItem> UnsentItems { get; }