Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
24 views

Configure email alert when data comes/insert on table

I have configured Database mail, test email is being sent successfully to designated recipient who were part of OPERATORS but I need to configure email alert when data comes/insert on table "abc" ...
-2
votes
1answer
41 views

Style bodytext while sending email using sp_send_dbmail [closed]

I am working on an email alert in trigger where body text has to be styled like this: Counterparty: a Previous Status: (Any status should be red) New Status: TRDNG OK(Green colored and Bold Upper)...
0
votes
1answer
37 views

No email alert on Procedure fail

I have configured Database mail and alert, test email is being sent successfully to designated recipient who were part of OPERATORS but I have created an alert on EXECUTE PROCEDURE (exec ...
2
votes
0answers
154 views

SQL Server attaches files to mail very slowly [closed]

I've been trying to send email from SQL server using sp_send_dbmail stored procedure. I have a file stored in a temp folder under my C drive that I'd like to include as an attachment. Looking at ...
5
votes
1answer
581 views

Is .NET Framework 3.5 still needed with a SQL Server 2017 installation to utilize Database Mail?

I'm guessing .NET Framework 3.5 is still needed to use Database Mail with SQL Server 2017? As I had to include this on my SQL Server 2016 installs on Server 2016 not that long ago. I was unable to ...
2
votes
0answers
24 views

How to get more details about root cause of failed Database Mail SSL connection

I'm trying to send database mail over SSL/TLS-encrypted SMTP. It works when sending plain text email, but fails when I enable SSL/TLS. The database mail log shows the following error message: Date ...
0
votes
0answers
84 views

how to collect the information provided by tokens in order to troubleshoot failing jobs quickly?

I was working on a way to take advantage of the SQL Server Agent Tokens and Macros because I work a lot with jobs and job steps and sometimes I have to notify different people depending on the outcome ...
0
votes
0answers
33 views

Database Mail on SQL Server Express 2017 [duplicate]

I followed this article to create a database mail for SQL Server Express 2017. I got it working but before that I had tried to create accounts and different profiles. How I do I list all database ...
-1
votes
2answers
75 views

SQL Server Express 2017 Database Mail Silent error

I have made an installation of a development environment in VMWare that contains: Windows Server 2016 SQL Server Express 2017 The objective is to perform migration tests of a base that is currently ...
4
votes
2answers
261 views

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? ...
0
votes
1answer
55 views

INSERT trigger not SELECTing rows

I'm working with a application and I have no control over the application source code, only SQL. The entire process is this: Row inserted via an application Vendor trigger fires and calls an SP to ...
2
votes
1answer
129 views

How to send Unicode symbols using SQL Server Database Mail? [closed]

How can I send Unicode symbols using SQL Server Database Mail? My goal is to send a symbol on the subject of an email. Let's say that, for example, I want to send this "🚯 Subject with symbol" on the ...
1
vote
1answer
106 views

how to identify the default mail configurations

In SQL Server, we can setup multiple email configurations out of which only some were set to default. I have tried using the following query to get the list of accounts: select * from msdb.dbo....
2
votes
3answers
64 views

User response to Database Mail

I'm doing some high level planning of an application at the moment. When a bcp import finishes, I'm going to send an email using Database Mail. I'd like the email to have options or filters for the ...
4
votes
1answer
357 views

How to send secure emails using sp_send_dbmail

When using sp_send_dbmail to send an email on SQL Server, how do you specify that the email be sent in an encrypted format? I found a thread discussing including the string "[SECURE]" in the subject ...
0
votes
1answer
43 views

Database Mail works in Production but not in Test Database

I have a Production database that is able to send mail. And a Test that is not able to. They are both on the same SQL Server. The error is (SQL Server 2008): Msg 229, Level 14, State 5, Procedure ...
-1
votes
1answer
44 views

Queries involved in deadlock [duplicate]

Is it possible to send queries involved in a deadlock via db mail alert in SQL Server 2005 on mail? If it is possible, then what is the best way to do this?
0
votes
0answers
236 views

Schannel 36871 Error when sending emails from Database Mail - after upgrading to SQL Server 2016

I have recently upgraded from SQL Server 2014 ENT to 2016 ENT, and now I cannot send emails from Database Mail. I get the usual The mail could not be sent to the recipients because of the mail ...
0
votes
1answer
31 views

Mail Alert when threshold of 10000 pendingcmds are breached

I currently have the below running to monitor replication and send a mail when the threshold of 10000 pendingcmds are breached, however the alert mail is generated every 5 minutes regardless of the ...
0
votes
1answer
262 views

Database Mail Configurations using gmail account

After creating a profile and account using gmail account smtp.gmail.com port 587 I get an error while trying to send a test email The mail could not be sent to the recipients because of the mail ...
2
votes
2answers
297 views

Database Mail on Amazon RDS / SQL Server

Since Database Mail is not supported on Amazon RDS with SQL Server, can anyone offer any suggestions on how to send e-mail notifications for failed SQL Server jobs in Amazon RDS? Thanks in advance ...
1
vote
0answers
75 views

Oracle Apex IR subscription not working

I have configured apex instance to use smtp email, and I can send email with IR when using download option from action menu. But the IR subscription is not sending emails. I have checked there is no ...
0
votes
1answer
300 views

Send email from SQL Server

I need to send email from SQL Server SP. Until now I used sp_send_cdosysmail. Is it better to use sp_send_dbmail? And the main question - which mail server is used by sp_send_dbmail - is it configured ...
-1
votes
1answer
430 views

Difference Between Database Mail Profile and SQL Server Agent Operator in MS SQL Server

I have configured Database Mail profile with several accounts. In the SQL Server Agent Properties I've enabled my profile. If I specify whom to send email with Database Mail profile, why do I need to ...
1
vote
0answers
92 views

SQL Server Agent Alert does not pick up some of Events from Application Log written by SQL Server Audit

My end goal is to be emailed when new object (schema, table, procedure etc.) is created / altered / dropped at one of my databases on SQL Server I created a server-level audit, that writes to Windows ...
7
votes
3answers
2k views

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, ...
0
votes
1answer
48 views

job send email to developers upon complexion and include DBAs if it fails

I have a job that sends an email to an operator (which contains a list of emails within it) upon complexion. Some of these people that are on that list are the developers who build everything in that ...
0
votes
2answers
348 views

msdb..sp_send_dbmail does not work with @query only with @body

I'm trying to execute the following: msdb.dbo.sp_send_dbmail --@body='Hi from sql server in a sproc' @query='select 1' ,@recipients='mkohn@***.com' ,@subject = 'Test' When I uncomment @body line, ...
2
votes
1answer
914 views

How do I find a job that sends a specific email?

I had a job sending an irrelevant email to a group of users. The title of the email was Staging -> [AUPAIR] arrivalDate trigger issue. When I query the jobs table in the msdb database using the ...
0
votes
0answers
27 views

Redirect all sysmail emails to one address for testing purposes

I want to test sending emails from multiple stored procedures but redirect them all to one email instead of spamming real users. Is it possible to configure sysmail to only send email to one address,...
1
vote
0answers
556 views

How to specify the path of an attachment stored on a different computer in the same network

I'm trying to send an email through SQL Server. The sp_send_dbmail has a parameter to specify the path of a file to send as an attachment. It works perfectly when the file is in the same server where ...
3
votes
1answer
100 views

Has anyone had luck sending dbmail via relay to an external server on an Azure VM (which appears to block SMTP outbound regardless of rules)?

Typically the servers we manage we handle a lot of the alerting for the SQL noise via operators/profiles/DBMail which gives us the most raw information about any issues that crop up on the server. It ...
2
votes
1answer
219 views

How can I email query results formatted in html from MSSQL 2000 server?

The only system SP I have is master.dbo.xp_smtp_sendmail and I can't make it work (or I just don't know how). I cannot upgrade the DB at this time. I'm trying something like this: @body_text=N'...
0
votes
1answer
81 views

Database Mail Stop Working

SQL Server 2016 Enterprise Edition SP1 Database Mail was working fine with no problem until a server patching was performed. I tried to do all the troubleshooting available but still all mails got ...
0
votes
1answer
254 views

Creating Database Mail with T-SQL returns “principal name is not valid”

Configuring Database Mail is so long. So I want to create a script that automatically create it for me DECLARE @YourEmail NVARCHAR(50) SET @YourEmail = 'MyEmail@mydomain.com' --Put here your E-mail ...
2
votes
1answer
442 views

SQL Server Agent/Properties/Alert System/Mail Session/Test is disabled

In order to enable operator notifications I navigated to SQL Server Agent/Properties/Alert System/Mail Session, checked "Enable mail Profile", selected Mail System and Mail Profile. At this time Test ...
1
vote
1answer
185 views

Database Mail works for one Instance but not three others

I have a test box with 4 Instances of SQL Server on it. One 2012 instance and three 2008 R2 instances. Database mail works fine on one of the named 2008 R2 Instances but not on any of the others. I'...
1
vote
1answer
329 views

Adding CASE statement to flag percentage available less than 5% as red ELSE green

USE [TEST] GO CREATE PROCEDURE [dbo].[SQLDBA_DatabaseSpaceReport] AS BEGIN DECLARE @dMaxLogDate Datetime = (SELECT TOP 1 LogDate FROM SQLDBA_PS_Get_DbaDatabaseSpace ORDER BY LogDate DESC) DECLARE @...
1
vote
0answers
332 views

sp_send_dbmail sending failed even status is sent

I had an issue since last week wherein the last received e-mail was last Dec 29. The job had no problem since it was created (months ago). The problem is we haven't receiving the e-mail even when ...
5
votes
1answer
3k views

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 ...
1
vote
1answer
589 views

Occasional error: Could not obtain information about Windows NT group/user 'domain\user', error code 0x54b [closed]

I have a query that will impersonate as a specific domain user to send email with attachment. This impersonation is required as it needs to read a file at some other server to be able to attach the ...
-1
votes
1answer
117 views

T-Sql - Issue setting SQL Agent Database Mail

So, for SQL 2008 R2 or below, when looking in: SQL Server Agent Properties Alert System Mail System I see SQLMail (Urrggghh) and Database Mail (hurrah) When I use msdb.dbo....
0
votes
1answer
335 views

Compare rows from two different tables and if there is a difference send a mail showing the diffence

I would like to change my query so it only shows values that have changed. I am comparing values between a current and history table. The query as it is shows all values and i have to trail the mail ...
3
votes
2answers
609 views

DB mail sending attachment of size 64 KB only even after increasing maximum file size limit

I am facing an issue with DB mail functionality. I am using SQL Server Agent to trigger mail on success or failure. While sending this, I am also providing an attachment, which consists of some query-...
2
votes
1answer
1k views

Comprehensive troubleshooting of DatabaseMail

I am having a problem sending email from one of my servers. I want to use DatabaseMail and/or msdb.dbo.sp_send_dbmail I have other production servers that use all the same databaseMail settings ...
0
votes
1answer
159 views

SQL Server 2016 Cluster - mail works in alerts; sp_send_dbmail dosen't send in jobs

I upgraded from 2008 R2 to a 2016 cluster [Microsoft SQL Server 2016 (SP1) (KB3182545) - 13.0.4001.0 (X64)]. We have some scheduled emails that happen from the agent that are reporting success as the ...
0
votes
1answer
470 views

SQL Server 2016- Email Alerts fo Errors/ Warnings

I am using Microsoft SQL Server 2016 I am trying to set up email alerts for errors and I am getting this error: 07/24/2017 19:42:23,,Error,3111,The mail could not be sent to the recipients because ...
1
vote
0answers
795 views

How to send big email via procedure sp_send_dbmail?

I need to send emails via MS SQL server. But the problem is that I have too much information to send. Let's say 50-200Kb per one mail. This is HTML formatted reports. For sending, I run ...
1
vote
2answers
386 views

SQL Job is getting failed randomly while trying to send the alert email. need help

We have configured a alert which triggers the email using a job. But the job fails randomly during the day and we don't receive the alert related mails. If I clear the ExternalmailQueue it starts ...
1
vote
0answers
105 views

DB mail stopped working on Clustered instance

Database mail stopped working after enabling 'Hide instance' and 'Disable remote connection' on SQL 2008 R2 two node clustered instance however DB mail is working fine on SQL 2016 two node clustered ...