﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Administering / SQL Server 2005  / Error using sp_send_dbmail / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sun, 19 May 2013 19:36:16 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Error using sp_send_dbmail</title><link>http://www.sqlservercentral.com/Forums/Topic815258-146-1.aspx</link><description>Try to use SA account as a Test</description><pubDate>Tue, 08 Jan 2013 19:56:46 GMT</pubDate><dc:creator>qaiser2001pk</dc:creator></item><item><title>RE: Error using sp_send_dbmail</title><link>http://www.sqlservercentral.com/Forums/Topic815258-146-1.aspx</link><description>Paul,How I can vinculate a SQL Server account to Windows account?Thanks by your help,</description><pubDate>Wed, 11 Nov 2009 16:55:55 GMT</pubDate><dc:creator>Lisset</dc:creator></item><item><title>RE: Error using sp_send_dbmail</title><link>http://www.sqlservercentral.com/Forums/Topic815258-146-1.aspx</link><description>Nothing has changed to the SP they are using the standard one.</description><pubDate>Tue, 10 Nov 2009 05:07:25 GMT</pubDate><dc:creator>Peter Gadsby</dc:creator></item><item><title>RE: Error using sp_send_dbmail</title><link>http://www.sqlservercentral.com/Forums/Topic815258-146-1.aspx</link><description>I meant the output might help explain it to me! :-DIt didn't.  I suppose your SQL Server team might have hacked sp_send_dbmail - the default procedure has an EXECUTE AS 'dbo' on the procedure, but an EXECUTE AS CALLER wrapped around the bit that attaches the file.I wonder if they have changed that to EXECUTE AS SELF/OWNER/a user mapped to a windows login and removed the EXECUTE AS CALLER bit...?  Wouldn't be supported, but it's an interesting idea.  I might try it later just to see.Paul</description><pubDate>Tue, 10 Nov 2009 05:04:31 GMT</pubDate><dc:creator>Paul White</dc:creator></item><item><title>RE: Error using sp_send_dbmail</title><link>http://www.sqlservercentral.com/Forums/Topic815258-146-1.aspx</link><description>Nop still don't understand, perhaps I'm having a blonde day!The output shows....TCP	TSQL	SQLCOMWTSV06	DATA_LOAD	DATA_LOADDATA_LOAD being the local user login.... Listen don't worry, it's working for me I was just trying to help the original poster......</description><pubDate>Tue, 10 Nov 2009 04:53:58 GMT</pubDate><dc:creator>Peter Gadsby</dc:creator></item><item><title>RE: Error using sp_send_dbmail</title><link>http://www.sqlservercentral.com/Forums/Topic815258-146-1.aspx</link><description>Peter,Are you able to run:[code]select net_transport, protocol_type, auth_scheme from sys.dm_exec_connections where session_id = @@spid;select [host_name], login_name, original_login_name from sys.dm_exec_sessions where session_id = @@spid;[/code]...please?The results may help explain things.Paul</description><pubDate>Tue, 10 Nov 2009 04:26:16 GMT</pubDate><dc:creator>Paul White</dc:creator></item><item><title>RE: Error using sp_send_dbmail</title><link>http://www.sqlservercentral.com/Forums/Topic815258-146-1.aspx</link><description>Hmmm still don't understand....I am on a Citrix server, connecting to SQL Server remotely using a local SQLSERVER user.My NT account has NO permissions to the SQLSERVER box, I can't even login to the server.When I call the command ....	EXEC msdb..SP_SEND_DBMAIL 		@RECIPIENTS= 'XXX@XXX.com',		@PROFILE_NAME = 'MAIL',		@SUBJECT = 'TEST',		@BODY = 'TEST',		@BODY_FORMAT = 'HTML',		@file_attachments  = 'C:\New Text Document (2).txt'The email is successfully sentI can also send an email using an attachment using a UNC path....	EXEC msdb..SP_SEND_DBMAIL 		@RECIPIENTS= 'XXX@XXX.com',		@PROFILE_NAME = 'MAIL',		@SUBJECT = 'TEST',		@BODY = 'TEST',		@BODY_FORMAT = 'HTML',		@file_attachments  = '\\comdata01\Shared\orchard.log'What am I missing?</description><pubDate>Tue, 10 Nov 2009 04:00:18 GMT</pubDate><dc:creator>Peter Gadsby</dc:creator></item><item><title>RE: Error using sp_send_dbmail</title><link>http://www.sqlservercentral.com/Forums/Topic815258-146-1.aspx</link><description>[quote][b]Peter Gadsby (11/10/2009)[/b][hr]I dont understand why we don't get the error 'files requires an integrated client login.' We can use a local login to send an email with an attachment![/quote][quote][b]Books Online[/b][hr]Database Mail uses the Microsoft Windows security context of the current user to control access to files. Therefore, users who are authenticated with SQL Server Authentication cannot attach files using @file_attachments. Windows does not allow SQL Server to provide credentials from a remote computer to another remote computer. Therefore, Database Mail may not be able to attach files from a network share in cases where the command is run from a computer other than the computer that SQL Server runs on.[/quote][url]http://msdn.microsoft.com/en-us/library/ms190307.aspx[/url]Paul</description><pubDate>Tue, 10 Nov 2009 03:33:52 GMT</pubDate><dc:creator>Paul White</dc:creator></item><item><title>RE: Error using sp_send_dbmail</title><link>http://www.sqlservercentral.com/Forums/Topic815258-146-1.aspx</link><description>I dont understand why we don't get the error 'files requires an integrated client login.' We can use a local login to send an email with an attachment!Pete</description><pubDate>Tue, 10 Nov 2009 03:09:29 GMT</pubDate><dc:creator>Peter Gadsby</dc:creator></item><item><title>RE: Error using sp_send_dbmail</title><link>http://www.sqlservercentral.com/Forums/Topic815258-146-1.aspx</link><description>I agree with Paul. Your error seems to indicate that you need a Windows login to send the mail and not a SQL login. Can you add a Windows login to your instance and test it and let us know if it works or not?</description><pubDate>Mon, 09 Nov 2009 15:44:43 GMT</pubDate><dc:creator>Joie Andrew</dc:creator></item><item><title>RE: Error using sp_send_dbmail</title><link>http://www.sqlservercentral.com/Forums/Topic815258-146-1.aspx</link><description>Guys,[quote][b]Lisset (11/6/2009)[/b][hr]Servidor: mensaje 22051, nivel 16, estado 1, línea 0The client connection security context could not be impersonated. [b]Attaching files requires an integrated client login.[/b][/quote]There's a huge clue right there ;-)Paul</description><pubDate>Mon, 09 Nov 2009 15:20:08 GMT</pubDate><dc:creator>Paul White</dc:creator></item><item><title>RE: Error using sp_send_dbmail</title><link>http://www.sqlservercentral.com/Forums/Topic815258-146-1.aspx</link><description>I has run test mail with rpp logged and this user have permissions in the drive.</description><pubDate>Mon, 09 Nov 2009 14:29:19 GMT</pubDate><dc:creator>Lisset</dc:creator></item><item><title>RE: Error using sp_send_dbmail</title><link>http://www.sqlservercentral.com/Forums/Topic815258-146-1.aspx</link><description>Also is the D: drive a mapped drive? if so try using the UNC path instead. Also have you checked that the SQL Server service login has permission to look at the directory.Pete</description><pubDate>Mon, 09 Nov 2009 09:30:17 GMT</pubDate><dc:creator>Peter Gadsby</dc:creator></item><item><title>RE: Error using sp_send_dbmail</title><link>http://www.sqlservercentral.com/Forums/Topic815258-146-1.aspx</link><description>Hi Hmmmmm Did you run the test mail when logged in using your rpp account? Also did you try running the send mail command from SSMS (also using the rpp account)?Pete</description><pubDate>Mon, 09 Nov 2009 09:26:27 GMT</pubDate><dc:creator>Peter Gadsby</dc:creator></item><item><title>RE: Error using sp_send_dbmail</title><link>http://www.sqlservercentral.com/Forums/Topic815258-146-1.aspx</link><description>Hi Peter:-&amp;gt;;Have you had a look at your mail profile and sent a test email?Yes and was succesfull. And have anonymous authentication.</description><pubDate>Mon, 09 Nov 2009 09:23:04 GMT</pubDate><dc:creator>Lisset</dc:creator></item><item><title>RE: Error using sp_send_dbmail</title><link>http://www.sqlservercentral.com/Forums/Topic815258-146-1.aspx</link><description>In our mail profile we use anonymous authentication... Do you use that?</description><pubDate>Mon, 09 Nov 2009 08:59:04 GMT</pubDate><dc:creator>Peter Gadsby</dc:creator></item><item><title>RE: Error using sp_send_dbmail</title><link>http://www.sqlservercentral.com/Forums/Topic815258-146-1.aspx</link><description>Hi,I don't think this is the problem, as I have just run the same command in my environment....msdb..SP_SEND_DBMAIL			@RECIPIENTS = 'XXX@XXXXXX.com',		@PROFILE_NAME ='MAIL',		@SUBJECT = 'TEST',		@BODY='TEST',		@BODY_FORMAT = 'HTML',		@file_attachments  = 'C:\WWW.sql'I used a local login and all worked fine.Have you had a look at your mail profile and sent a test email?RegardsPeter Gadsby</description><pubDate>Mon, 09 Nov 2009 08:56:13 GMT</pubDate><dc:creator>Peter Gadsby</dc:creator></item><item><title>RE: Error using sp_send_dbmail</title><link>http://www.sqlservercentral.com/Forums/Topic815258-146-1.aspx</link><description>Please can you tell me how I can mapping a SQL Server login to Windows account? because I cant change the user 'rpp' for execute the SP.</description><pubDate>Mon, 09 Nov 2009 08:44:23 GMT</pubDate><dc:creator>Lisset</dc:creator></item><item><title>RE: Error using sp_send_dbmail</title><link>http://www.sqlservercentral.com/Forums/Topic815258-146-1.aspx</link><description>[quote][b]Lisset (11/6/2009)[/b][hr]Servidor: mensaje 22051, nivel 16, estado 1, línea 0The client connection security context could not be impersonated. Attaching files require an integrated client login[/quote]The user 'rpp' is a SQL Server login.You must use a login mapped to a Windows account - also known as an 'integrated client login'.Sending mail requires that the server act on behalf of the login, this is only possible with a Windows login - SQL Server logins cannot take part in Windows impersonation.</description><pubDate>Sat, 07 Nov 2009 02:31:38 GMT</pubDate><dc:creator>Paul White</dc:creator></item><item><title>Error using sp_send_dbmail</title><link>http://www.sqlservercentral.com/Forums/Topic815258-146-1.aspx</link><description>Hi everybody. I have a problem I am connecting to Database with user 'rpp' and when execute this code:   EXEC msdb.dbo.sp_send_dbmail      @profile_name = 'Administrator',           @recipients = 'lisset.arce@ewong.com',           @file_attachments = 'D:\SQLoutput\OLD_cobranza.txt',           @subject = 'Prueba RIMAC - Detalle de Cobranza'  Show the follow error:Servidor: mensaje 22051, nivel 16, estado 1, línea 0The client connection security context could not be impersonated. Attaching files require an integrated client loginThe user rpp have the el role DatabaseMailUserRole.Maybe I have to activate something?Thanks for your help</description><pubDate>Fri, 06 Nov 2009 16:42:42 GMT</pubDate><dc:creator>Lisset</dc:creator></item></channel></rss>