Click here to Skip to main content
15,913,115 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have got this by writing select From,To,Subject, Body from xyz. and for example it returned 20 records and i want to send mails. Is it possible directly ??? without using Cursor and all ??
Posted
Comments
Thanks7872 11-Oct-13 4:39am    
Get all the records in datatable. Loop through it,pass these values to the function which is supposed to send mail,that's it.
deepakdynamite 11-Oct-13 5:13am    
Its a procedure which is used to send Email. and that cannot be called from function
Prasad Khandekar 11-Oct-13 5:24am    
Hello Deepak,

Nope, you will have to use cursor. In case the email contents are same for every one then sp_send_dbmail can send same email to multiple recipients (http://technet.microsoft.com/en-us/library/ms190307.aspx).

Regards,
Mubin M. Shaikh 17-Oct-13 7:33am    
Hi you can go for concatenation of you emails using looping and then pass them as parameter to function to send email at once.

you need to specify what exactly you need.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900