Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to set up access to MSSQL 2005 Database Mail?
    primarykey
    data
    text
    <p>I've just setup Database mail within MSSQL 2005. I have been able to send email from an administrator account on the server and through a SQL Server Agent job. But, I unable to send email when I tried to send email via a login that just has access to a database for our web application.</p> <p>What is the best way to set up access to Database Mail?</p> <p>I have 2 senerios where I want to send email.</p> <ol> <li>Schedule a job through SQL Server Agent to run a Stored Procedure that does some process and then sends an email. (this hasn't been a problem)</li> <li>Have a stored procedure invoked from a web application that calls another stored procedure which could send an email. (this is were my permissions issue is)</li> </ol> <p><strong><em>Possible Solutions</em></strong></p> <ol> <li><p>The only way that I have found to grant permission to a login is to map the login to the <strong>msdb</strong> database and grant the <strong>public</strong> and <strong>DatabaseMailUserRole</strong>. This really concerns me as I would assume that this gives to much access to the <strong>msdb</strong> database.</p></li> <li><p>Store the email I want to send in a table and then have a SQL Server Agent job look at that table every so often to send any queued emails. This way the database login for the web application does not execute the [msdb].[dbo].[sp_ send _dbmail] call and thus does not need any permission to the <strong>msdb</strong> database.</p></li> </ol> <p>Are there any other solutions?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload