Database Mail Multiple address

  • 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

  • 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.

  • 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


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply