Advanced Querying

SQLServerCentral Article

Using Xp_sendmail With the Recipients Generated From a Query

  • Article

Xp_sendmail is a great utility that SQL Server provides in order to e-mail messages directly from SQL Server, by using a valid MAPI profile. However, its syntax is rather stringent. In this article by Kunal Das, he shows you how to send messages to a list of recipients generated by a query dynamically in T-SQL.

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2005-02-18 (first published: )

24,018 reads

Blogs

Word to the wise: don’t turn on SQL vulnerability checks on a blog about SQL

By

Recently, in an attempt to thwart leechers (1990s kids will know), I added some...

Dazzling Stuff in Databricks (SQL) – Qualify

By

Once upon a time I had a series about some cool stuff in Snowflake:...

Advice I Like: Overnight Success

By

“Most overnight successes – in fact any significant successes – take at least 5...

Read the latest Blogs

Forums

The Speed of Count

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The Speed of Count

Detecting Outliers in Power BI Using IQR

By Dinesh Asanka

Comments posted to this topic are about the item Detecting Outliers in Power BI...

Moving to a New Platform

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Moving to a New Platform

Visit the forum

Question of the Day

The Speed of Count

Which of these might run quicker on the AdventureWorks database in SQL Server 2025?

-- A
select count(*) from AdventureWorks.Sales.OrderDetail

-- B
select count(1) from AdventureWorks.Sales.OrderDetail

-- C
select count(OrderDetailID) from AdventureWorks.Sales.OrderDetail

See possible answers