SQL Server Performance

sp_send_dbmail

Discussion in 'SQL Server 2005 General DBA Questions' started by kappa02, Mar 17, 2011.

  1. kappa02 New Member

    I have a maintenance plan which put out a report everyday after if runs, with the name as PlainMMDDYYYY. Using sp_send_dbmail, how can one have the report sent to the operator when the new file each day? I have at the end of the plan an Excute T-SQL Statement task which exec sp_db_mail but using the @file_attachment (parm) it won't get the newly name file each day.
  2. satya Moderator

    Welcome to the forums.
    In order to send mail using Database Mail in SQL Server, there are 3 basic steps that need to be carried out. 1) Create Profile and Account 2) Configure Email 3) Send Email. So you need to create the necessary set of steps to send dbmail.
    Also after the Account and the Profile are created successfully, we need to configure the Database Mail. To configure it, we need to enable the Database Mail XPs parameter through the sp_configure stored procedure, as shown here:
    sp_CONFIGURE 'show advanced', 1
    GO
    RECONFIGURE
    GO
    sp_CONFIGURE 'Database Mail XPs', 1
    GO
    RECONFIGURE
    GO

  3. satya Moderator

    Welcome to the forums.
    In order to send mail using Database Mail in SQL Server, there are 3 basic steps that need to be carried out. 1) Create Profile and Account 2) Configure Email 3) Send Email. So you need to create the necessary set of steps to send dbmail.
    Also after the Account and the Profile are created successfully, we need to configure the Database Mail. To configure it, we need to enable the Database Mail XPs parameter through the sp_configure stored procedure, as shown here:
    sp_CONFIGURE 'show advanced', 1
    GO
    RECONFIGURE
    GO
    sp_CONFIGURE 'Database Mail XPs', 1
    GO
    RECONFIGURE
    GO

Share This Page