November 10, 2011 at 8:34 am
Hi All,
We have 2 email addresses set up inside our SQL 2005, how do I specify which address the sp_sendemai proc uses??
Thanks
November 10, 2011 at 8:41 am
You can use @profile_name to determine which profile is the email being sent from. You can use @recipients parameter to send email to any number of email addresses sperated by semi colon.
November 10, 2011 at 8:42 am
the profile you setup for database mail contains the "from " address;\for multiple addresses, the @recipients parameter expects a semi-colon delimited list of emails:
EXEC msdb.dbo.sp_send_dbmail
@profile_name='My Profile Name',
@recipients='lowell@domain1.net;lowell@domain2.com',
@subject = 'Days Since Last Posting Report',
@body = @MailBody, --assume this was created and populated above as proper html string
@body_format = 'HTML'
Lowell
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply