sp_send_dbmail error

  • Testing our soon to be new production and getting this errror..

    Msg 515, Level 16, State 2, Procedure sp_validate_user, Line 19

    Cannot insert the value NULL into column 'permission path', table '@temp'; column does not allow nulls. INSERT fails.

    The statement has been terminated.

    Msg 14636, Level 16, State 1, Procedure sp_send_dbmail, Line 107

    No global profile is configured. Specify a profile name in the @profile_name parameter.

    When running this code...

    exec MSdb.dbo.sp_Send_DBmail

    @recipients = 'User',

    @subject = 'This is a test '

    I do have a profile set up in DBMail. Any ideas?

    ¤ §unshine ¤

  • To set up a global or default profile go to Database Mail -> Right-click -> Configure Database Mail. Select "Manage profile security" and on either the public or Private profiles tab select the Profile you want and set the Default Profile property to Yes. Now whenever you do not provide the @profile_name parameter this profile will be used.

    Or

    You can just supply the @profile_name parameter with your profile name.

  • Awesome! thanks!

    I run it now, but I get the message

    Mail queued.

    But not actually received.

    ¤ §unshine ¤

  • is your smtp server setup correctly? does the smtp server allow your ip address to be a relay?

    look up dbmail setup in BOL to see the status of those queued email.

    -----------------------------
    www.cbtr.net
    .: SQL Backup Admin Tool[/url] :.

  • From BOL:

    Diagnosing the Problem

    The Database Mail external program logs e-mail activity in the msdb database.

    First, use the SQL Server Surface Area Configurationutility to confirm that Database Mail is enabled.

    Then execute the following statement in the msdb database to check the status of the mail queue:

    Copy Code

    sysmail_help_queue_sp @queue_type = 'Mail' ;

    You need to have Service Broker enabled in msdb in order for mail to work. You can check that by running:

    Select

    is_broker_enabled

    From

    sys.databases

    Where

    name = 'msdb'

  • IT seesm as we have to put the full email address, where in sql 200 we did not. That worked and still sent the mail queued message, but just putting in the user name like before does not work.

    SB is enabled on both, and the results for the sysmail_help_queue_sp is

    node2

    mail0INACTIVE2008-08-20 20:56:30.3432008-08-20 20:35:16.463

    and node 1

    mail0INACTIVE2008-08-20 21:53:32.4372008-08-20 21:42:28.893

    ¤ §unshine ¤

  • That would make sense since Database Mail is smtp and SQL Mail used MAPI and was connected to your Exchange Server using Outlook.

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply