Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sending emails to several users from a query
Message
De
27/04/2009 22:36:36
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Titre:
Sending emails to several users from a query
Divers
Thread ID:
01396601
Message ID:
01396601
Vues:
117
I can send emails now from SQL, but I was wondering how to send emails to several recipients from a query and also the body contain information from another query. I used:
USE sipcopia
GO
EXEC msdb.dbo.sp_send_dbmail @profile_name='CorreoHelpdesk',
@recipients='SELECT     Usuario.Email AS responsablegrupo, Usuario_1.Email AS responsablepropuesta
FROM         ResponsablePropuesta INNER JOIN
                      Propuesta ON ResponsablePropuesta.Idpropuesta = Propuesta.IdPropuesta INNER JOIN
                      Prospecto ON Propuesta.IdProspecto = Prospecto.IdProspecto INNER JOIN
                      Estado ON Propuesta.IdEstado = Estado.IdEstado INNER JOIN
                      Usuario ON ResponsablePropuesta.RespGrupo = Usuario.IdUsuario INNER JOIN
                      Usuario AS Usuario_1 ON ResponsablePropuesta.RespPropuesta = Usuario_1.IdUsuario
WHERE     (DATEDIFF(y, GETDATE(), ResponsablePropuesta.FechaPlanEntrega) = 1)',
@subject='mensaje de prueba',
@body='Don Jose, si le llega este correo por favor confirme a.' 
but it seems not working. How can i solve this?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform