Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Error using sp_send_dbmail


Error using sp_send_dbmail

Author
Message
Lisset
Lisset
SSC Journeyman
SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)

Group: General Forum Members
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
Paul White
Paul White
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10338 Visits: 11350
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
SQLPerformance.com
SQLblog.com
@SQL_Kiwi
Lisset
Lisset
SSC Journeyman
SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)

Group: General Forum Members
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.
Peter Gadsby
Peter Gadsby
SSC-Enthusiastic
SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)

Group: General Forum Members
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
Peter Gadsby
Peter Gadsby
SSC-Enthusiastic
SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)

Group: General Forum Members
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
Lisset
Lisset
SSC Journeyman
SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)

Group: General Forum Members
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.
Peter Gadsby
Peter Gadsby
SSC-Enthusiastic
SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)

Group: General Forum Members
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
Peter Gadsby
Peter Gadsby
SSC-Enthusiastic
SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)

Group: General Forum Members
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
Lisset
Lisset
SSC Journeyman
SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)

Group: General Forum Members
Points: 92 Visits: 341
I has run test mail with rpp logged and this user have permissions in the drive.
Paul White
Paul White
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10338 Visits: 11350
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
SQLPerformance.com
SQLblog.com
@SQL_Kiwi
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search