Questions tagged [sqlmail]

SQL Mail is provided in Microsoft SQL Server for backward compatibility. To send mail from SQL Server.

SQL Mail is provided in Microsoft SQL Server for backward compatibility. To send mail from SQL Server.

SQL Mail provides a mechanism to send, receive, delete, and process e-mail messages. Messages can be triggered to provide a recipient with a particular result set from a specified SQL Server query.

19 questions
7
votes
3 answers

difference xp_sendmail and sp_send_dbmail proc

Can I ask what is the difference between xp_sendmail and sp_send_dbmail proc? They are both send e-mail message, which may include a query result set attachment, to the specified recipients..... What is the difference?
Elya
3
votes
1 answer

Unable to clear SQL Server sysmail queue

Last night due to some bad code, my SQL Server tried sending a million emails. After 10k the emails started going into queue. I immediately stopped the sysmail service using exec sysmail_stop_sp. Then I deleted all entries from sysmail_allitems,…
2
votes
1 answer

SQL Server 2005: Difference between SQL mail and DB mail

Ok. I know SQL Mail is less secure and old, but what are the real advantages and differences between the two? I read this article, which is pretty straight forward, but I was hoping to get someone to tell me why (if any) would you want to use SQL…
Fandango68
  • 4,461
  • 4
  • 39
  • 74
2
votes
2 answers

Ms SQL send mail

Hi somebody can help me with this please? declare @account_name varchar(128) = 'Test Mail Account' declare @description varchar(128) = 'Mail account for administrative e-mail.' declare @email_address varchar(128) = 'abc@xyz.com' declare …
RJaniii
  • 25
  • 6
1
vote
2 answers

Updating SQl database via email

Below is my requirement. Depending upon some condition I want to send the mail to the xyz user which will have two links "Accept" and "Reject" in the message body. When the recepient clicks either of the link an update/insert should be performed in…
prathamesh
  • 11
  • 2
1
vote
2 answers

DB Mail could not sent mail to the recipients because of the mail server failure in sql server 2012

I have tried to send database mail but the following issue occurs. The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 3 (2018-11-13T13:05:31). Exception Message: Could not connect to mail…
Vengat
  • 235
  • 1
  • 5
  • 16
1
vote
2 answers

SQL email rows not aligning

I have a job setup to email when the disk space falls below 20 %. Right now everything works great except when it comes to the results in the email. I have tried changing the query_result_width to every possible variation. I want to send it in…
CM_Heroman
  • 378
  • 1
  • 7
  • 21
1
vote
1 answer

REPLACE statement on T-SQL Email body causes null values

I have a simple procedure that sends an email on a user creation. To populate the username and fullname fields, I am loading the body of the email from a config table and then using REPLACE to replace placeholders. SELECT @BodyMessage = ConfigValue…
Bill Sempf
  • 976
  • 2
  • 13
  • 40
1
vote
1 answer

Troubleshooting A Simple SQL Server Trigger

I'm using SQL Server 2008 here. I inherited an old web app that is dying, and being replaced by a totally new web app. The new project is up and running but the old one will exist for the next month and a half for the transition period. Here's the…
shubniggurath
  • 956
  • 1
  • 15
  • 31
0
votes
0 answers

SQL Server Mail not reliable

We have a SQL Server 2016 Standard Edition. I set up the SQL mail service (account + profile) on it a year ago, which worked perfectly (account: smtp.office365.com:587, SSL, basic auth). Since October 11, 2021, there have been constant problems with…
cofeee
  • 23
  • 4
0
votes
0 answers

The mail could not be sent to the recipients because of the mail server failure(SQL) using office 365

I have executed the following. EXEC msdb.dbo.sp_send_dbmail @profile_name='Client_Messages', @from_address= 'Client Automation ', …
Noufal netspective
  • 101
  • 1
  • 1
  • 8
0
votes
2 answers

Get values dynamically from tables while sending mails from SQL Server

I have a table: CREATE TABLE A(Id INT, Val VARCHAR(100)) INSERT INTO A VALUES (1,'MyData+format(getdate(),''yyMMdd'')+.CSV') DECLARE @out VARCHAR(100) SELECT @out = Val FROM A WHERE Id = 1 EXEC sp_send_dbmail @profile_name='MyProfile', …
DineshDB
  • 5,998
  • 7
  • 33
  • 49
0
votes
1 answer

SQL database Mail Service

In SQL Server I have written a script for sending the mail from SQL Database where i am using xml for getting data into proper table format. Now i want multiple tables to be displayed in mail from multiple query. some sample document is attached for…
Kiran Madake
  • 21
  • 1
  • 6
0
votes
1 answer

Send Email as HTML Table from SQL Server

I am trying to send an email from my SQL Server using SQLmail, but I cannot get the output I desire. Below is an example of what I want: email body:- Hello: Following program has been submitted by @username at getdate() for your review. Please…
0
votes
0 answers

Stored procedure invokes SQL mail intermittently

I have a stored procedure that looks at a table for new entries with particular criteria and invokes SQL mail if found. A job executes the sp every 15 minutes. Sometimes it emails the new entries, but other times the SQL job runs successfully, but…
John C
  • 1
  • 1
1
2