|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Wednesday, April 11, 2012 9:32 AM
Points: 92,
Visits: 341
|
|
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 0 The client connection security context could not be impersonated. Attaching files require an integrated client login
The user rpp have the el role DatabaseMailUserRole. Maybe I have to activate something?
Thanks for your help
|
|
|
|
|
SSChampion
        
Group: General Forum Members
Last Login: Wednesday, May 08, 2013 10:33 AM
Points: 10,989,
Visits: 10,529
|
|
Lisset (11/6/2009) Servidor: mensaje 22051, nivel 16, estado 1, línea 0 The client connection security context could not be impersonated. Attaching files require an integrated client login 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.
Paul White SQL Server MVP SQLblog.com @SQL_Kiwi
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Wednesday, April 11, 2012 9:32 AM
Points: 92,
Visits: 341
|
|
| 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.
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Tuesday, April 16, 2013 9:27 AM
Points: 138,
Visits: 303
|
|
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?
Regards
Peter Gadsby
Peter Gadsby Business Intelligence Consultant www.hgconsult.co.uk
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Tuesday, April 16, 2013 9:27 AM
Points: 138,
Visits: 303
|
|
In our mail profile we use anonymous authentication... Do you use that?
Peter Gadsby Business Intelligence Consultant www.hgconsult.co.uk
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Wednesday, April 11, 2012 9:32 AM
Points: 92,
Visits: 341
|
|
Hi Peter: ->;Have you had a look at your mail profile and sent a test email? Yes and was succesfull. And have anonymous authentication.
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Tuesday, April 16, 2013 9:27 AM
Points: 138,
Visits: 303
|
|
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
Peter Gadsby Business Intelligence Consultant www.hgconsult.co.uk
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Tuesday, April 16, 2013 9:27 AM
Points: 138,
Visits: 303
|
|
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
Peter Gadsby Business Intelligence Consultant www.hgconsult.co.uk
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Wednesday, April 11, 2012 9:32 AM
Points: 92,
Visits: 341
|
|
| I has run test mail with rpp logged and this user have permissions in the drive.
|
|
|
|
|
SSChampion
        
Group: General Forum Members
Last Login: Wednesday, May 08, 2013 10:33 AM
Points: 10,989,
Visits: 10,529
|
|
Guys,
Lisset (11/6/2009) Servidor: mensaje 22051, nivel 16, estado 1, línea 0 The client connection security context could not be impersonated. Attaching files requires an integrated client login.
There's a huge clue right there 
Paul
Paul White SQL Server MVP SQLblog.com @SQL_Kiwi
|
|
|
|