Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Error using sp_send_dbmail Expand / Collapse
Author
Message
Posted Friday, November 6, 2009 4:42 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC 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
Post #815258
Posted Saturday, November 7, 2009 2:31 AM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Today @ 6:23 AM
Points: 9,928, Visits: 11,196
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
Post #815359
Posted Monday, November 9, 2009 8:44 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC 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.
Post #815833
Posted Monday, November 9, 2009 8:56 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, June 11, 2013 9:11 AM
Points: 138, Visits: 305
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
Post #815846
Posted Monday, November 9, 2009 8:59 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, June 11, 2013 9:11 AM
Points: 138, Visits: 305
In our mail profile we use anonymous authentication... Do you use that?


Peter Gadsby
Business Intelligence Consultant
www.hgconsult.co.uk
Post #815849
Posted Monday, November 9, 2009 9:23 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC 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.
Post #815884
Posted Monday, November 9, 2009 9:26 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, June 11, 2013 9:11 AM
Points: 138, Visits: 305
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
Post #815889
Posted Monday, November 9, 2009 9:30 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, June 11, 2013 9:11 AM
Points: 138, Visits: 305
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
Post #815894
Posted Monday, November 9, 2009 2:29 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC 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.
Post #816138
Posted Monday, November 9, 2009 3:20 PM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Today @ 6:23 AM
Points: 9,928, Visits: 11,196
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
Post #816186
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse