Sp_send_dbmail Mail Queued. Message
May 2, 2006
I have an After Update Trigger specified on a database table to notify specific users via email when certain customer values are modified. (This is a HACK / Workaround for functionality that doesn't exsist in the product.)
I had be using xp_sendmail without a problem. I recently upgraded the database server to SQL2005 and wanted to try sp_send_dbmail. (I was interested in the asynch and the non-MAPI nature of Database Mail.)
This is the new code:
EXEC @retval = msdb.dbo.sp_send_dbmail
@recipients = @rec,
@blind_copy_recipients = @bcc,
@subject = 'Important Customer Information Change',
@body = @body
This is the old code:
EXEC @retval = master.dbo.xp_sendmail
@recipients = @rec,
@blind_copy_recipients = @bcc,
@subject = 'Important Customer Information Change',
@message = @body
The problem now is that the application reports an update failure because the sp_send_dbmail return the message "Mail Queued."
I don't know if there's a way to suppress this message or not. Or some other way to indicate that "all is well" even though the stored procedure returned a message.
Thanks in advance.
View 6 Replies
ADVERTISEMENT
Jul 22, 2015
This is my syntax which looks valid to me, but the message will never send, need to get the message to send? (@recipients & @from_address are junk here, but valid email addresses in my procedure)
Code:
exec msdb.dbo.sp_send_dbmail
@profile_name = 'DatabaseMail',
@recipients = 'loggedinuser@domain.com',
@body_format = 'HTML',
@from_address = 'SQLEmailAccount@domain.com',
@body = 'Test 12345',
@subject = 'Test Email From SQL Server';
View 10 Replies
View Related
Jul 19, 2015
I want to send an email twice a day, from database. So I have planned to make a storedproce which will be called by a job (which will select some record from one table and put it in other table based on a flag) but I want to run it in a transaction so that if email is send successfully then only it should commit else it should rollback.
How can i find that "Mail queued" now i should commit.
View 4 Replies
View Related
Oct 19, 2006
We have a ASP.Net 2.0 web application and need to send out emails. We have an EmailQueue table in our database where email gets stored before it is send out. We are looking at the pros and cons of using Database Mail in SQL Server 2005 to send out our emails. Should we use SQL or our web app to send email???Tips, tricks, articles, experiences, opinions are greatly appreciated. Newbie
View 2 Replies
View Related
Oct 17, 2007
When i use sp_send_dbmail stored procedure inside a Execute SQL task,the task is executed successfully.
But when i look in to 'Database Mail Log', it says
"The mail could not be sent to the recepient because of the mail server failure. Exception message: cannot send mails to mail server(The remote certificate is invalid according to the validation procedure)
Please let me know what can be the issue.
View 2 Replies
View Related
Apr 15, 2008
Hi all,
I am having a few problems with Database Mail and wondered if anyone could assist. It sends test mails fine, but when I run the following script:
(I've changed my email address in this post to test@test.com they are accurate in the scripts.)
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'Test Mail',
@recipients = 'test@test.com',
@body = 'Sent by sp_send_dbmail',
@Subject = 'SQL Server Email Test Email';
It gives the following errors.
(from the above script)
mailitem_id = 16
profile_id = 2
recipients = test@test.com
copy_recipients = NULL
blind_copy_recipients = NULL
subject = SQL Server Email Test Email
body = Sent by sp_send_dbmail
body_format = TEXT
importance = NORMAL
sensitivity = NORMAL
file_attachments = NULL
attachment_encoding = MIME
query = NULL
execute_query_database = NULL
attach_query_result_as_file = 0
query_result_header = 1
query_result_width = 256
query_result_separator =
exclude_query_output = 0
append_query_error = 0
send_request_date = 2008-04-15 10:50:03.827
send_request_user = COMPANYTest.Test
sent_account_id = NULL
sent_status = failed
sent_date = 2008-04-15 10:50:04.000
last_mod_date = 2008-04-15 10:50:04.513
last_mod_user = sa
(from the test mail)
mailitem_id = 11
profile_id = 2
recipients = test@test.com
copy_recipients = NULL
blind_copy_recipients = NULL
subject = Database Mail Test
body = This is a test e-mail sent from Database Mail on UKDEVSQL1
body_format = TEXT
importance = NORMAL
sensitivity = NORMAL
file_attachments = NULL
attachment_encoding = MIME
query = NULL
execute_query_database = NULL
attach_query_result_as_file = 0
query_result_header = 1
query_result_width = 256
query_result_separator =
exclude_query_output = 0
append_query_error = 0
send_request_date = 2008-04-15 09:51:46.530
send_request_user = COMPANYTest.Test
sent_account_id = 4
sent_status = sent
sent_date = 2008-04-15 09:51:46.000
last_mod_date = 2008-04-15 09:51:46.610
last_mod_user = sa
sysmail_event_log gives this error for mail item 16 (the scripted email):
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 4 (2008-04-15T10:11:41). Exception Message: Cannot send mails to mail server. (Mailbox unavailable. The server response was: 5.7.1 Requested action not taken: message refused). )
View 2 Replies
View Related
Jul 12, 2006
I tried to send message through SQL mail. After sent, it said that the mail has been sent. But, when I open the Outlook 2003. The message was in Inbox with a error msg: "This message has not been sent". Is there anyone ever faced this problem before?
View 1 Replies
View Related
Jun 9, 1999
I'm running SQL Server 6.5 (SP5a) on an NT4 server (SP3). I am using the Outlook Express account for SQLExecutiveCmdExec
which has all the requisite permissions. SQL Executive as well as SQL Server services are logging in under this account.
The server seems to be functioning normally in every other way (there's no production data on it yet).
When attempting to start SQL Main, the following lines appear in the Errorlog
1999/06/09 16:15:16.62 ods Starting SQL Mail session...
1999/06/09 16:15:16.64 ods Error : 17951, Severity: 18, State: 1
1999/06/09 16:15:16.64 ods Failed to start SQL Mail session.
1999/06/09 16:15:16.64 ods OS Error : 126, The specified module could not be found.
MSKB Does not have any information on this error message. Can anyone provide some insight as to what's going on please?
P.S. I have another server running SQL Mail with the same configuration with no problem.
View 2 Replies
View Related
Oct 27, 2013
I need to set a trigger so that an email is generated when a row is inserted into the ABC_DB_OnlineFormsConfirm table. The message will include data not only from that table, but from a related table called ABC_DB_OnlineForms. The common field between the two is FormID. This is related to an online account application process where the user has the option of completing it in one session, or saving it and coming back at a later time. Once the user has completed the first screen and clicks continue, a record is written to ABC_DB_OnlineForms. At the very end, when he clicks “Save and Complete”, a row is written to the ABC_DB_OnlineForms table. I would like the body of the email to include three separate lines, as follows. The first two pieces of data come from the OnlineForms table and the third from OnlineFormsConfirm. The field names are userid, IRSBackup and ConfirmationCode.
UserID:
Subject to IRS Backup Withholding?:
Confirmation Code:
What I have below results in an email body that contains the confirmation code all by itself. If I switch @body=@MessageBody to @body=@UserID or @body=@Backup, it will report the correct single piece of data, but I have no idea how to get all three pieces at once as separate lines including the leading descriptor (UserID:, Confirmation Code, etc.).
CREATE TRIGGER SendEmail
ON [ABC].[dbo].[ABC_DB_OnlineFormsConfirm]
AFTER INSERT
AS
Begin
Declare @MessageBody varchar(100)
[code]...
View 7 Replies
View Related
May 2, 2008
i have developed a pakage which populates a two different tables with reference to the xml files added to a folder which is watched by a security WMI task.it is governed by a sequence container which contains three for each loop container for working on the different files.i have different event handlers set up inside for each loop container tasks which contains , data flow task, execute sql task, and moving the processed file to the desired destination.i want to set up a send mail task on the package level using event handler on error, where i have set up a task for looging the error to the error table , i have tried to collect all the error messages in a array list variable . and trying to use that variable a s a message source. i could not under stand if i set the propogation variable in the sequence container as false than will the onpost execute event will fire the onpostexecute event handler in the package level.if show how can i send only one email for all the errors of package with error looging.
View 6 Replies
View Related
Mar 28, 2008
while i was trying to execute the code for Sending an "HTML Mail Message with the Script Task" given at the link below http://msdn2.microsoft.com/en-us/library/ms403365.aspx
following error was encountered.
DTS Script Task has encountered an exception in user code:
Project namecriptTask_098956444e9f4ae195c3565569c9444b
The element cannot be found in a collection. This error happens when you try to retrieve an element from a collection on a container during execution of the package and the element is not there
at Microsoft.SqlServer.Dts.Runtime.Variables.get_Item(Object index)
at ScriptTask_098956444e9f4ae195c3565569c9444b.ScriptMain.Main() in dts://Scripts/ScriptTask_098956444e9f4ae195c3565569c9444b/ScriptMain:line 29
please help me
View 7 Replies
View Related
Jun 13, 2007
hi
I am trying something very simple but cannot see why it is failing.
I am trying to add a filename to the message source of a mail task from a variable.
I have Variable 1 User::CurrentFilePath, Scope = ForEachLoop, Data Type = String
and Variable 2 User::mailSource, Scope = ForEachLoop, Data Type = String
Variable 2 EvaluateAsExpression is set to True and the Expression for now is simply "Processing of File " + [User::CurrentFilePath] + "has Begun"
However when i enter this i get
The expression for variable "Test2" failed evaluation. There was an error in the expression.
In the Value and Value type boxes of the variable property.
Any advice greatly received
Regards
Scott
View 1 Replies
View Related
Oct 3, 2006
I set up the "Send Email Task" succesfully with "SMTP Connection to myExchangeSERVER" using "Windows Authentication"
However, as we all know - you can't have html format for the Send Mail Task. BUT this piece of code straight from MSDN doesnt work for me - each time it pops up this "Mail Sent Succesfully" - but I receive NO freaking EMAILs!!! Am I missing something or is it another one of those Microsoft "gotchas" ?
Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Runtime
Imports System.Net.Mail
Public Class ScriptMain
Public Sub Main()
Dim htmlMessageTo As String = "me.here@mydomain.com"
Dim htmlMessageFrom As String = "SSIS@mydomain.com"
Dim htmlMessageSubject As String = "SSIS Success - My Package"
Dim htmlMessageBody As String = _
Dts.Variables("User::HTMLtemplateText").Value.ToString
Dim smtpServer As String = "myExchangeSERVER"
SendMailMessage( _
htmlMessageTo, htmlMessageFrom, _
htmlMessageSubject, htmlMessageBody, _
True, smtpServer)
Dts.TaskResult = Dts.Results.Success
End Sub
Private Sub SendMailMessage( _
ByVal SendTo As String, ByVal From As String, _
ByVal Subject As String, ByVal Body As String, _
ByVal IsBodyHtml As Boolean, ByVal Server As String)
Dim htmlMessage As MailMessage
Dim mySmtpClient As SmtpClient
htmlMessage = New MailMessage( SendTo, From, Subject, Body)
htmlMessage.IsBodyHtml = IsBodyHtml
mySmtpClient = New SmtpClient(Server)
Dim myCred As New System.Net.CredentialCache()
mySmtpClient.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials
mySmtpClient.Send(htmlMessage)
MsgBox("Mail sent")
End Sub
View 3 Replies
View Related
Apr 3, 2007
Hi all,I've a problem with sql server 2000 EE.I've a DB with a table with lots of records. I run a SELECT fromquery analyzer, and I've results in 10 seconds. Perfect.When I run the query two times in the same table, seems likeit been queued. Result in 20 seconds.With another query, I've result in 40 seconds. If I run this query 2times, I've results in 80 seconds.How can it be? Does Sql Server queue the query?thanks, and sorry for bad english! :D
View 3 Replies
View Related
Jan 9, 2007
When multiple readers are waiting on a message from the same queue, I would expect that the reader that has been waiting the longest would be the first to pick up a message. However, I'm shocked to discover that the opposite seems to be true; in my tests I'm showing that the reader that has been waiting the least time picks up a message first! This seems totally counter-intuitive, and I'd like to know why it's working this way. This implementation will cause a lot more reader timeouts to occur than a properly queued method. For instance, assume that I have two readers, each using a one minute timeout. Reader #1 starts waiting, and reader #2 is busy for another 20 seconds before it starts waiting. 39 seconds later a message comes in and reader #2 will pick it up, leaving reader #1 to time out one second later! I would much rather have reader #1 pick up the message and reader #2 continue to wait for 20 more seconds.
I'm considering filing a bug on Connect about this, but I thought I'd post here first and see if I can get an answer...
Following is the script I'm using to test:
---Setup / Window #1---
--------------------------------------
CREATE DATABASE SimpleSSB
GO
USE SimpleSSB
GO
--Create a database master key
CREATE MASTER KEY
ENCRYPTION BY PASSWORD = 'onteuhoeu'
GO
--Create a message type
CREATE MESSAGE TYPE Simple_Msg
VALIDATION = EMPTY
GO
--Create a contract based on the message type
CREATE CONTRACT Simple_Contract
(Simple_Msg SENT BY INITIATOR)
GO
--create a queue
CREATE QUEUE Simple_Queue
GO
--Create a service
CREATE SERVICE Simple_Service
ON QUEUE Simple_Queue
(Simple_Contract)
GO
--------------------------------------
---Go start the other windows now---
---Readers: Windows #2-n ---
--------------------------------------
USE SimpleSSB
GO
WAITFOR
(
RECEIVE *
FROM Simple_Queue
), TIMEOUT 300000
--------------------------------------
---Start at least two readers, then do---
--------------------------------------
--send a message...
DECLARE @h UNIQUEIDENTIFIER
BEGIN DIALOG CONVERSATION @h
FROM SERVICE Simple_Service
TO SERVICE 'Simple_Service'
ON CONTRACT Simple_Contract
WITH ENCRYPTION=OFF;
SEND ON CONVERSATION @h
MESSAGE TYPE Simple_Msg
GO
--------------------------------------
... the last reader you've started will pick up the message first. Note I'm testing on 9.0.3033, in case that matters.
Thanks!
View 7 Replies
View Related
Apr 24, 2008
What command can I issue from query analyzer to list tasks in the queued_tasks table. I would like to see tasks assigned to be run, completed, running, and error.
Thanks
View 5 Replies
View Related
Sep 10, 2006
Dear friends
I have a simple doubt.
1)What is the difference between Queued Updating & Immediate Updating in Transactional Relplication.
2)What is the difference between Meged Replication & Peer to Peer replication.Because in both each node will Act as Publisher/Subscriber.So load balancing is possible both type replication na?
3) how to replicate views,stored procedure & functions.Beacuse when applying intial snapshot the copy is getting in subscriber.But afterwards whatever changes occurring in view,procedure not propagating from publisher to subscriber.what to do in this case
Filson
View 1 Replies
View Related
Mar 7, 2008
Hi All,
I have a problem replicating data from Subscriber to Publisher.
I configured Queued updatable subscriptions in transactional replication. Publisher is on SQL Server Standard edition and Subscriber is on SQL Server Express edition, both on Windows XP.
When I insert/update data in publisher, the data is replicated to subscriber. If I insert/update data on subscriber the data is not replicated. When I see the replication monitor for errors, it shows an error "Cannot load a DLL xprepl.dll or one of its resources".
Could any one give me a solution or please tell me if I missing something?
Thanks you all,
Ravi.
View 6 Replies
View Related
Jul 19, 2015
I want to send an email two ice a day, from database. So I have planned to make a storedproce which will be called by a job (which will select some record from one table and put it in other table based on a flag) but I want to run it in a transaction so that if email is send successfully then only it should commit else it should rollback.
How can i find that "Mail queued" now i should commit.
View 1 Replies
View Related
Oct 17, 2007
Hi
I'm running transactional repl with updateable subscribtions - queued updating. Running SQL 2005 sp2, win 2003 sp1
I have 18 odd subscribers at the moment, my publisher and disttribution is on the same machine with push subscriptions.
The questions I have
nr 1.
While trying to initialize new subscribers I get loads of deadlocks even after I stop dist cleanup agent. This *I think* cause some other unexpected problems.
nr2.
The queue reader would fail saing it cannot find the "insert" proc on the publisher, although it exists.
I have changed anything on the publication so I'm not sure how this happens or why.
nr3.
I replicate a varbinary(max) column and on the odd occasion get the "Length of LOB data" errors which I then set with sp_configure. The catch here is that the length never exceeds a "len()" of 4000, thus the reported LOB and my calculation doesn't tie up.
Help is appreciated.
Thanks
View 3 Replies
View Related
May 9, 2006
When using "sp_send_dbmail", messages are queued through Service Broker. Other than the system views, "dbo.sysmail_...", in MSDB, is there another way to know if an email was sent successfully?
Also, in 2000 you did not need to supply the whole email address in order for xp_sendmail to work. For example, I could use my name, "RGioia" as the recipient and it would send email to rgioia@<my current domain>. Does anyone know of a work-around for this in 2005 or do you just have to ensure that full email addresses are used?
Thanks in advance!!
View 1 Replies
View Related
Aug 8, 2007
I wrote a trigger as follows:
CREATE TRIGGER TR_ABC
ON TABLE_A
AFTER INSERT
AS
DECLARE @E_MAIL VARCHAR(255),
@MESSAGE VARCHAR(255)
SET @MESSAGE = 'A new call request has been logged'
SELECT @E_MAIL = E_MAIL
FROM TABLE_A AS A
LEFT OUTER JOIN TABLE_B AS B
ON B.SYSADMIN = A.SYSADMIN
WHERE SYS_ADMIN = 1
EXEC MSDB.DBO.SP_SEND_DBMAIL
@profile_name = 'SCINFO',
@recipients = @E_MAIL,
@body = @MESSAGE,
@subject = 'SCI Service Request';
The problem is everytime I insert data into the table I get an error stating that-:
'At least one of the following parameters must be specified. "@recipients, @copy_recipients, @blind_copy_recipients".
Mail queued.'
Please help.
View 1 Replies
View Related
May 1, 2007
SQL Server 2005Help. I have a problem:On a 2000 box, I am calling the sp_send_dbmail stored procedure on a2005 box (they are linked servers).This is how I'm calling the proc (from the 2000 box), which usessp_send_dbmail to send the mail.EXEC My2005Server.DatabaseName.dbo.SendNotification@recipients = 'me@yahoo.com',@subject = 'SENDING @TOTAL,@body = @text1 + @text2 + @text3 + @text4 + @text5@text1 - @text5 are varchar(8000).As you can see I'm trying to take advantage of the varchar(max) that@body allows.However, I get this error:Server: Msg 170, Level 15, State 1, Line 22Line 22: Incorrect syntax near '+'.I need to be able to concatenate these somehow... as I cannot put theminto one large variable from the 2000 server side.Can you see the problem here?Help.Thanks
View 1 Replies
View Related
Oct 31, 2007
Hello all,
I'm new to this forum and have the same question on SQLTeam.com, where I'm a frequent forum user.
I'm trying to send the results of a table to a group of people by email, see code used below:
exec msdb.dbo.sp_send_dbmail @profile_name = 'DT', @recipients = 'isantos@foo.net;', @subject = 'QA Results', @body = 'Some Text', @query = 'select * from [db].[dbo].[table]', @execute_query_database = 'db', @exclude_query_output = 1, @append_query_error = 1;
Error message I get by email:
Msg 15404, Level 16, State 19, Server TAKKARA, Line 1 Could not obtain information about Windows NT group/user 'WECLICKisantos', error code 0x5.
If I remove the @query, @exclude_query_output and @append_query_error options, I can send the email without a problem, just whenever I try to add a query to it that it gives me this error message.
I'm a sysadmin, I can run that query, I have access to the DatabaseMailUserRole under msdb and the profile that I'm using is public... I'm kind of stuck, let me know if you can help.
View 3 Replies
View Related
Apr 14, 2008
I'm running the following test
declare @dbccdate varchar(60)
set @dbccDate='dbcc east' + convert(varchar(60),getdate(),10)
exec msdb.dbo.sp_send_dbmail
@recipeints='human@gmail.com',
@body = 'This is a test'
@subject= @dbccdate ,
@query='dbcc checkdb (msdb)',
@attach_query_result_as_file=1,
@query_attachment_filename='Dbcc_MSDB_Results.txt'
This works fine but, I'd really like the subject to contain the line
"Checkdb found 0 errors..." So mgmt doesn't have to open the txt file to view the results.
I've tried dumping the results to a txt file first. Then trying to read the text file for the line inquestion. I wrote a for loop to parse the results command line, but can't figure how to add that value to the subject.
The script is this:
for /f %i in ('findstr /B /I "CHECKDB" y:dbcclogmsdblog.txt') do echo %i
Is there anyway to do this?
View 5 Replies
View Related
Apr 25, 2007
Have a funny one that I've not yet resolved, and was wondering if I am the only one.
SQL2005 SP1 server, Ent Ed, 64 bit, clustered machine.
SP2a installed over Easter weekend.
about 12 days after apparently succesful upgrade, the cluster was failed over. After that fail-over, an existing job started failing, with the following message:
quote:Error executing extended stored procedure: Invalid Parameter [SQLSTATE 42000] (Error 22050). The step failed.
All the job does is build a SQL query, then supply the query to sp_send_dbmail for execution:
DECLARE
@RetCodebit,
@Tovarchar(200),
@Subjectvarchar(100),
@CCvarchar(200),
@Queryvarchar(max),
@Debugsmallint
--cut section that has the query , but these are straight SQL
--queries - no SP or XP usage whatsoever
EXEC@RetCode = msdb.dbo.sp_send_dbmail
@profile_name= 'Email',
@recipients= @To,
@subject= @Subject,
@copy_recipients= @CC,
@query_result_header=0,
@Query=@Query
One 'funny' I noticed is that up until the failover, SSMS seemed to erport the version of the server as still the SP1 (2157). After failover, it now lists (3042). This may simply be a symptom of SSMS not auto-refreshing though. We have (I believe) failed back again since then, still no joy.
Any Ideas?
*##* *##* *##* *##*
Chaos, Disorder and Panic ... my work is done here!
View 5 Replies
View Related
Feb 26, 2008
I am trying to use the sp_send_dbmail sproc but I get the following error:
Msg 22051, Level 16, State 1, Line 0
Attachment file C: est.txt is invalid.
My code:
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'SQL Server Mail Profile blah blah',
@recipients = 'myEmail@somewhere.com,
@body = 'Hello World',
@subject = 'Hello World',
@file_attachments = N'C: est.txt'
why would that be? The test.txt file does exist on my drive!
Please advise.
View 9 Replies
View Related
Aug 22, 2007
I have a table which contains a list of addresses to send an email to. I'd like to be able to do something like:
update emaillist
set sendcount = SendMyMessage( emailaddress )
where sendcount = 0
In this case SendMyMessage is a user defined function which calls the sp_send_dbmail stored procedure.
However, I am receiving an error saying "Only functions and extended stored procedures can be executed from within a function"
From what I've seen, it sounds like I am forced to use a cursor to go through my email list table. Is that the only way?
Under SQL 2000, using a user defined function to call CDONTS was a no brainer....
Thanks,
Chris.
View 3 Replies
View Related
Mar 23, 2006
I just started getting these errors on a few (not all) servers the other day. These servers have been running fine for a few months now...
Msg 14661, Level 16, State 1, Procedure sp_send_dbmail, Line 476
Query execution failed: Error initializing COM
Msg 0, Level 11, State 0, Line 0
A severe error occurred on the current command. The results, if any, should be discarded.
I can only find one thread regarding this error, specifically with dbmail and I am doing the same thing (executing a query and attaching the results).
http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=149&messageid=248650
This thread points to a KB article http://support.microsoft.com/kb/910416 which is close except for the fact that these were not upgrades, but clean installs. I'm leary of applying the hotfix to my servers.
Is this a known issue internal to MS and is the referenced hotfix appropriate to install?
View 8 Replies
View Related
May 28, 2008
I have a stored procedure that sends an mail using sp_send_dbmail. My problem is, if I execute the stored procedure via my ASP.NET 2005 application, the email will not send. I know the stored procedure is being called and works because:
1. The stored procedure does 2 things, sets a status, then sends the email. The status is being changed, but the email is not being sent.
2. When I investigate with Sql Server Profiler, I see the stored proc being called and the values of the parameters are set as they should be.
What I don't understand is, I can copy the call in Sql Server Profler, and paste it in a Query Analyzer window and execute that same call, and everything works fine, status is changed, and the email is sent (to myself for testing and I receive it just fine).
Is there a reason why the email won't send via code? Am I suppose to setup some security that will allow my application to send emails? Any info would be GREATLY appreciated.
View 2 Replies
View Related
Aug 2, 2007
Hi,
We have a DTS package in the old SS2000 that we are still using in SS2005. We change the old xp_sendmail to use the new sp_send_dbmail. This runs fine without attachment. But with attachment, I'm encountering an error when running the package.
The task reported failure on execution.
The client connection security context could not be impersonated. Attaching file requires an integrated client login.
Syntax error or access violation.
I cannot find much topic on the net about this error.
Thanks very much for any help.
Regards
View 1 Replies
View Related
Jan 23, 2008
Hi everyone,
I'm trying to usie "sp_send_dbmail" and i'm required to provide value to: "@profile_name" argument. The trouble is i have no idea what it means..
How do i get to know what is my "profile_name" ?
Thanks.
View 1 Replies
View Related
May 15, 2008
Hallo
I want to write a trigger that sends me an email, when new records are added into a table.
For testing I have created one table called location1, which has simple data from AdventureWorks.Production.Location. And another table is called new_location, which stores the newly added records.
Here is the trigger:********************************
use [AdventureWorks]
if object_id ('location1') is not null
drop table location1
go
create table location1(LocationID int, LName varchar(50))
if object_id ('new_location') is not null
drop table new_location
go
create table new_location
(LocationID int, LName varchar(50))
if object_id ('change_ID', 'TR') is not null
drop trigger change_ID
go
create trigger change_ID on location1
for insert
as
delete new_location
insert into new_location
select * from inserted
exec sp_send_dbmail
@profile_name = 'Profile',
@recipients = 'email',
@subject = 'New Record(s) added.',
@query = 'select * from new_location order by LocationID';
go
********************************
After I insert statement, Management Studio runs the executing throughout.
insert into location1
select LocationID, Name
from Production.Location
order by LocationID
Can somebody help?
View 2 Replies
View Related