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 ...

learn more… | top users | synonyms (1)

16
votes
2answers
26k views

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 ...
10
votes
1answer
223 views

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 ...
8
votes
1answer
4k views

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(), ...
6
votes
1answer
2k views

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 ...
4
votes
1answer
1k views

Database Mail to Distribution List

I have a SQL Server 2005 which I have configured the database mail to setup monitoring alerts and notifications. I also create a email distribution list containing a couple of emails. The thing is ...
4
votes
2answers
4k views

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 ?
4
votes
1answer
675 views

Denied access sending dbmail while impersonated under a login with sysadmin privilege

This question is similar to but not the same as this. I created a stored procedure and set it to execute under the context of a sysadmin login (let's called it sys1). For testing purposes, I only ...
4
votes
3answers
668 views

sp_send_dbmail fails when mailing queries, but no error returned, query just hangs

I have an issue SQL Server 2005. sp_send_dbmail fails when mailing out with the result of a query (inline or attatchment). No error message is given / reported, the query just keeps executing but ...
4
votes
1answer
3k views

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 sproc as a lightweight way to distribute simple reports. This often entails producing a ...
3
votes
2answers
9k views

Create job to send alert using sp_send_dbmail when table value greater than x

PROBLEM The SMScounter.Counter is used to accumulate usage from a service. The service has a programmatic cap of 1000. I would like to alert users when this cap is breached. TABLE CREATE CREATE ...
3
votes
2answers
693 views

Configure Email to be sent on restoring a database

Is there a way to configure Email in SQL Server such that an Email is sent when a particular database is restored.
3
votes
3answers
2k views

Unable to get DBMail working on SQL Server 2005

I have SQL Server 2005 SP3 (4053) running on a Windows Server 2003 R2 virtual machine. When trying to send a test dbmail message, either from the SSMS GUI or using sp_send_dbmail, I get the ...
3
votes
2answers
119 views

Assigning permissions for sysmail_update_account_sp

I have a Microsoft SQL Server 2014. The mail system is configured via DBMail and there is one stored proc in main web app (having its own database) which executes msdb's sysmail_update_account_sp by ...
3
votes
2answers
1k views

SQL Server Database Mail - Why can't I run an execute against xp_sysmail_activate?

SQL Server 2008 R2 Standard x64 I can't send e-mail from this SQL Server (out of MANY that are configured pretty much identically AFAIK). I have created the mail profile and account. However, any ...
3
votes
0answers
1k views

SQL DatabaseMail smtp error 5.7.57 at one site, email works at another with the same details

I have several SQL databases on different servers. I have used a script to set up Database mail. EXECUTE msdb.dbo.sysmail_add_account_sp @account_name = 'Emailer' ,@description = 'Email out ...
3
votes
0answers
231 views

sp_send_dbmail causes session to hang

We had an issue in production (2008R2 SP3) yesterday, where a developer was running a piece of code in SSMS that was executing sp_send_dbmail inside a transaction, and including an attachment from a ...
2
votes
2answers
2k views

Securely Send Database Mail via an Insert Trigger

I have spent about 30 hours so far trying to get sp_send_dbmail to work. I finally got SOMETHING to work, but I have serious doubts as to its security. I would like know a method which is better yet ...
2
votes
2answers
15k views

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 ...
2
votes
1answer
3k views

Can you have multiple Oracle ACL files?

I have an application which needs to send emails through Oracle triggers. I understand that in Oracle 11g you must have an ACL file to grant certain schemas access to the network. My plan was to ...
2
votes
2answers
368 views

SQL-Server login-error of SQL-Server Agent Account

I have to manage a configured SQL-Server version 2005 and have setup Database Mail successfully - test mail works. Also I've changed the agent service to a domain user with (currently) domain admin ...
2
votes
2answers
4k views

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 ...
2
votes
2answers
9k views

Problem sending an attachment using dbo.sp_send_dbmail

This question has been asked on the main stackexchange site I was referred here by a user there. ...
2
votes
2answers
3k views

how to use database mail from SSIS

I try to use gmail in database mail. I have no problem to send out email from it. But how I can configure my send mail task to send out email by using database mail. Thanks
2
votes
1answer
78 views

SQL job is completing without sending email to configured recipients

I have an SQL job completing without sending email to configured recipients. Here is the stored procedure I am using. Names changed accordingly. All other mail is getting sent via db mail through a ...
2
votes
1answer
588 views

Enable Agent Database Mail - TSQL

I have several new servers that need Database Mail configured on them. I found the TechNet article describing how to add the profile and account via procedure calls, but is there a way to enable ...
2
votes
1answer
2k views

Error checking with sp_send_dbmail

This question is kind of multifaceted. First, what I'm trying to actually accomplish: I am in an environment where there is not really heavy data validation on inputs. So there is lots of opportunity ...
2
votes
2answers
4k views

Replace the server name in email sender address when sending email from SQL Server 2008

I'm sending emails directly to Microsoft Outlook accounts from SQL Server 2008. Everything is fine, email was sent. Only problem is that in the header of the email the SQL Server name is embedded. ...
2
votes
1answer
273 views

SQL Server Alert - Description (None) [closed]

For every system Alert defined to send an email, we receive a 2 alerts with the following bodies. How do I stop the message with the empty (None) description? Empty Alert SQL Server Alert System: ...
2
votes
1answer
3k views

SQL Server Database Mail failing to send emails with error Sender address rejected: Access denied

The environment is a 2 node 2008 SQL Cluster. The first node was running fine but after failover to the second node Database Mail no longer can send emails. I am using Basic authentication. The ...
2
votes
2answers
38 views

Database email to know the history of backups

I need to send an email by listing different types of backups, time of backups, summary of these backups, backup file path and name of backup with the help of database email. Can anyone help me with a ...
2
votes
0answers
214 views

SQL Server Database Mail Log is flooded with errors (20-30 per second) when mail server goes down

We're using SQL Server 2005. Every so often our mail server goes down, and when this happens, as soon as our SQL code tries to send dbmail, the Database Mail Log has an item which looks like this: ...
2
votes
1answer
198 views

Can SQL Server 2008 R2 get email name resolution from Office 365?

We just moved from an on premise Exchange server to Office 365's Exchange Online. My question is, is there any way to still get email name resolution from Office 365? I have many stored procedures ...
1
vote
2answers
155 views

Is Database Mail worth the risk / a standard practice

I enabled Database Mail XPs and was testing it on my dev machine. I was just wondering if the DB Mail is a bad security choice, and if it more secure (or standard practice) to send this kind of ...
1
vote
1answer
29 views

Modifying the Contents of SQL Server Agent Alerts

As is generally recommended to do, I have Alerts configured for errors of severity 19 and greater that occur on my SQL Servers. However, as part of an email notification standardization process, I'm ...
1
vote
1answer
42 views

How to schedule emails out with SQL Server

I am creating an easy "service desk" web application with SQL Server as database. I have a table where the web application is inserting data which is used to send emails for alerting the users about ...
1
vote
2answers
242 views

Send CSV file with db_sendmail

I am trying to send a csv file with 15000 records via the database mail in SQL Server 2014. The problem is that when I open my email the csv only contains 209 records. I have tried the same thing in ...
1
vote
1answer
1k views

Elegant way of sending e-mails with Service Broker

Is there an elegant way for sending e-mails using a Service Broker service/queue? I want to setup an EVENT NOTIFICATION for SQL Server, and I'd like to send e-mails to operators for each message on ...
1
vote
1answer
52 views

grant dbmail access to account

We have a server with a number of (increasing) databases, each of the "databases" needs to be able to use dbmail. Each (database's) mail account is different and configured via a custom ui. We created ...
1
vote
1answer
114 views

Setting query to run as a stored procedure and email the results

I have the following query: select COUNT(CASE WHEN New_accounttype = 1 THEN New_AccountType ELSE NULL END) as 'New Connections' , COUNT(CASE WHEN New_accounttype = 2 THEN New_AccountType ELSE NULL ...
1
vote
1answer
1k views

Sending a mail using DB2's Proceude UTL_MAIL

I'm trying to send mail from DB2 using the procedure UTL_MAIL. I'm using the DB2 Express Edition 10.1. First I was getting the error of SMTP Server. After using the below command, update admin cfg ...
1
vote
1answer
28 views

Database Mail stops working after browser service stopped

After stopping the browser service on a 2-node SQL Server failover cluster system, the Database Mail component stopped working. It fails and creates log entries as follows: ...
1
vote
1answer
36 views

Minimum permissions required for mail attachment in DbMail

I know that SQL DbMail requires for attaching, a windows login or a sysadmin privilege is required. This is somewhat similar to minimum dbMail permissions which was asked by me at an earlier point. ...
1
vote
2answers
612 views

How to delete list of email addresses from MySQL database?

I have a list of invalid email addresses parsed in the following format; There are roughly 1500 invalid addresses, and I need to remove them from my myBB users. What SQL query can I run to remove ...
1
vote
1answer
1k views

Logshipping alert emails are being sent out while there is no error

I have logshipping setup with a Primary and a Secondary, and this has been working fine for a long time. Yesterday I started reveiving these emails: The log shipping primary database ...
1
vote
1answer
2k views

Database Mail Issue

I am getting a strange error randomly when i try to send emails using database mail using SQL Server. The mail could not be sent to the recipients because of the mail server failure.Exception ...
1
vote
0answers
47 views

Include failed step's error details in database mail for failed agent jobs

I receive database notification mail whenever a job fails. Error message of the failed job (Step Id=0 in the Job History) is included in the mail; MESSAGES: The job failed. The Job was invoked by ...
1
vote
2answers
33 views

How do I view operators in a Notify Operator task in a Maintenance Plan?

In the past, we have added each DBA to a Notify Operator task on failure in Maintenance Plans ranging from scheduled backups to indexing and occasionally one-off operations. One of our DBAs recently ...
1
vote
0answers
21 views

Grant permission to update dbmail

We want to grant a user the ability to update their own mail connection profile used by db mail in msdb. For example, when the IT company maintaining the mail server wants to change the password. We ...
1
vote
0answers
30 views

SQL Server 2005 Database Mail Resends Historic Messages following SP4 Build 5324

I have applied SP4 Build 5324 to a SQL Server 2005 Enterprise active/passive cluster (Build pathway: 4053 to 5000 to 5324). The SQL Server log contains zero errors. The SQL Server Agent log contains ...
1
vote
0answers
151 views

Database Mail connection to exchange - Resets and timeouts

I am trying to send the results of a query in an email, and each time it takes longer than 5-10 minutes for me to recieve the message. The actual relay from Exchange takes less than one minute, but ...