Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Sending Email in SQL Server
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Posting Yak Master

183 Posts

Posted - 02/09/2013 :  01:49:53  Show Profile  Reply with Quote
Hi Experts,

if I run one Query then I will get this result:
select responsibleprovider ,emailaddress from table1
responsibleprovider emailaddress
aaaa, bbbbb
ddddd, Pppp

if I run another query I get this result:
select Count ,responsibleprovider from tablereport

Count responsibleprovider
6 aaaa, bbbbb
8 ddddd, Pppp

I need to send this people email about the number of reports waiting for them (knowing their email address from the previous SQL):

For example, contact Email will get email: You have 1 report
aaaa, bbbbb will get email: You have 4 reports

I am new to Mail functionality in SQL Server ,
Could you please advice me , how to send an mail to repective preoviders with some text.



Edited by - Ranjit.ileni on 02/09/2013 01:51:13

Flowing Fount of Yak Knowledge

United Kingdom
2179 Posts

Posted - 02/09/2013 :  06:52:34  Show Profile  Visit jackv's Homepage  Reply with Quote
SQL Server comes with Database Mail. Use this article to assist in setting up Database Mail , which will allow you to send email from within your sql statements. You will need a valid smtp address to which you can point

Jack Vamvas
Go to Top of Page

Very Important crosS Applying yaK Herder

52326 Posts

Posted - 02/09/2013 :  08:24:56  Show Profile  Reply with Quote
you can also implement this in ssis using send mail task. Just add a connection to your email server and it will sent the mail.

SQL Server MVP

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000