Questions tagged [database-mail]

Database Mail is an enterprise solution for sending e-mail messages from the SQL Server Database Engine. Using Database Mail, your database applications can send e-mail messages to users. The messages can contain query results, and files from any resource on your network. Database Mail is designed for reliability, scalability, security, and supportability.

188 questions
57
votes
3 answers

How can I see the current Database Mail configuration?

Our SQL Server (2008) instance is configured to send mail and everything is working correctly, but I can't figure out how to view the existing configuration, in particular the SMTP server. From SSMS I can only start the configuration wizard, and I…
Alex
  • 673
  • 1
  • 5
  • 6
24
votes
4 answers

Enable TLS 1.2 for SQL Server 2016 database mail

I have been puzzled by this issue for almost 1 week. Hopefully someone in our community has experienced the same issue and already found a solution. So here is my problem: As per our company policy, we want database mail to be able to send emails…
jyao
  • 3,083
  • 1
  • 14
  • 27
18
votes
6 answers

SQL Server 2016 DB Mail Not Sending

I'm on SQL Server 2016 and having a blast... my DB Mail isn't sending and I'm running out of places to look. I double checked the SQL account permissions to the DBmail executable - it has read and execute. I entered a rule for the firewall outbound…
Dave
  • 2,399
  • 1
  • 12
  • 20
17
votes
2 answers

sp_send_dbmail stored procedure send with attachment

I've been tasked with sending a small monthly report to for one of my customers. The report has previously been run manually on the instance, the output copied to a spreadsheet and send to the customer as an attachment. I'm looking for a more…
Gareth
  • 313
  • 1
  • 3
  • 9
11
votes
2 answers

Need to Send a formatted HTML Email via Database Mail in Sql Server 2008 R2

My requirement is to create the automated email as ( A formatted HTML Email via Database Mail) The basic requirement has been completed where when the Job is triggered it inserts the data into a Table and that information has been scheduled to be…
Heisenberg
  • 1,505
  • 5
  • 18
  • 31
11
votes
1 answer

How to export the output of sp_AskBrent?

We have an instance that randomly spikes the CPU. I want to create an alert that fires on CPU over 90% and automatically calls a job that runs sp_AskBrent and emails me the output. However, the output is unreadable in either Text or HTML output. It…
Mick
  • 111
  • 2
10
votes
1 answer

What permissions does the service account need to use database mail?

I have an SQL Server 2012 instance running under a managed service account. I've configured database mail with one account and am trying to send a test email, but I'm getting some errors in the server's event logs: Database Engine…
Mansfield
  • 1,061
  • 8
  • 20
  • 33
10
votes
1 answer

SQL Server alerts not sending notification emails to the operator

I have setup few SQL Server alerts and added Operator to notify if any alert occurred. I just noticed that couple of alerts did occurred but we didn't receive any alert email. I did send a test notification email to the operator and it worked and we…
9
votes
2 answers

How to select the mail profile in a sql agent job

I have several mail profiles configured on sql agent, how can I choose which of these profiles gets used for sending out notifications on a specific sql agent job ?
nojetlag
  • 2,927
  • 9
  • 34
  • 42
9
votes
1 answer

Trouble With Database Permissions for sp_send_mail

I am trying to send database mail but I am getting EXECUTE permission denied on the object 'sp_send_dbmail' database 'msdb', schema 'dbo'.. I code I am running is as follows: SELECT SUSER_NAME(), USER_NAME(); Create USER kyle_temp FOR LOGIN…
Kyle Brandt
  • 2,335
  • 9
  • 29
  • 37
7
votes
1 answer

NVARCHAR(MAX) string appears to have 6326 characters but won't PRINT them all

I am writing a stored procedure to use the sp_send_dbmail system stored procedure to send an HTML email. I have used this procedure before but have not run into this problem before. I am using the build method laid out here From online I believe…
Ian W
  • 249
  • 2
  • 3
  • 11
7
votes
3 answers

Execute Sql statement and send result to email

I have to execute SQL statement every day and send result to dba by email.I configured database email. Below is query: SELECT account.accountID, account.name FROM account LEFT OUTER JOIN accountfeaturesetting afs…
user120625
  • 71
  • 1
  • 1
  • 2
6
votes
1 answer

Is there a way to force sp_send_dbmail to use ANSI, or to not include the Unicode prefix?

This is pretty trivial, but if someone has the answer handy, I'd appreciate it. I use the msdb..sp_send_dbmail stored procedure as a lightweight way to distribute simple reports. This often entails producing a CSV. However, the stored procedure…
Jon of All Trades
  • 5,987
  • 7
  • 48
  • 63
6
votes
2 answers

What are the sp_send_dbmail return values?

I have an email failing with function return value of '101' and @@error value of '0' (no rows are added to sysmail_allitems). Where can I find documentation on return codes for this function? Example code showing how I obtain the above values: exec…
youcantryreachingme
  • 1,655
  • 3
  • 21
  • 36
6
votes
3 answers

Can send test database mail but job emails failing

I stopped receiving sql agent job failure notifications in the recent past. Upon investigation the error reported is: The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1…
crichavin
  • 525
  • 1
  • 6
  • 19
1
2 3
12 13