Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2005 > SQL Server 2005
|
SQL Server 2005 General discussion of SQL Server *2005* version only.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 5th, 2009, 08:38 AM
Authorized User
 
Join Date: May 2007
Posts: 95
Thanks: 5
Thanked 0 Times in 0 Posts
Default Sending mails from SQL Server 2005

Hi All

I am trying to send mail through SQL Server 2005. I have configured the database for this and it works fine.

Here is the code :

Code:
EXEC msdb.dbo.sp_send_dbmail 
@recipients =@Email,
@subject ='New Alert',
@copy_recipients = @HEmail,
@importance ='High',
@body = @MailBody,
@body_format ='HTML';


In the @copy_recipients i have a parameter @HEmail which contains list of email id's with comma separated. e.g. like this - [email protected],[email protected],[email protected]
The problem is it is sending the mail with the first email only i.e [email protected] and the rest is ignored. How to solve this???
Also how to concatenate one email id like [email protected] with a paramter.
Please help....

-- Abhishek
 
Old May 11th, 2009, 01:52 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Use semicolon to separate emails:
[email protected];[email protected];[email protected]
http://msdn.microsoft.com/en-us/library/ms190307.aspx
__________________
Om Prakash Pant
Click the "Thanks" button if this post helped you.





Similar Threads
Thread Thread Starter Forum Replies Last Post
sending e-mails How To?? saudyonline General .NET 13 November 17th, 2006 01:00 AM
sending mails arabuafef Classic ASP Basics 0 July 18th, 2006 06:29 AM
Sending mails. rupen Javascript How-To 1 October 25th, 2005 07:22 AM
Sending e-mails using C# lily611 General .NET 3 June 30th, 2004 05:46 AM
Sending mails rajeshnerenki Pro VB 6 4 September 25th, 2003 03:34 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.