Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6574641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:17:12+00:00 2026-05-25T15:17:12+00:00

I need to send a email to all my subscribers. I am currently on

  • 0

I need to send a email to all my subscribers. I am currently on a shared hosting plan that offers a SQL Server 2008 database.

I really don’t want to copy all the emails into my mail client (thunderbird) nor do I want to make a program that would grab all the emails from the db and send it through smtp.net

I am looking for a free solution that I could just tell it the db path and the column of the emails and will allow me to write a subject and body and let me send it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:17:13+00:00Added an answer on May 25, 2026 at 3:17 pm
    1. Configure database mail with a profile that has the from / reply-to information matching what you want your recipients to see. You can see one tutorial here:
    • Setting up Database Mail for SQL Server
    1. Depending on whether you want to send the same message to everyone, or personalize each one, you can use a loop to either build up chunks of addresses to BCC (you won’t necessarily want to send to all the recipients at once) or to craft the individualized body/subject for each recipient.

    2. Once you have a body and recipient(s) in each iteration of the loop, you can use msdb.dbo.sp_send_dbmail to send each message.

    EDIT adding some sample code.

    Setup:

    USE tempdb;
    GO
    
    CREATE TABLE dbo.Emails(Email VARCHAR(320));
    
    INSERT dbo.Emails VALUES('a@b.com'),('b@c.com'),('c@d.com');
    

    If you want to just send all the same message and assuming the list is short – batching or chunking would be a different question:

    DECLARE @bcc VARCHAR(MAX) = '';
    
    SELECT @bcc += ';' + Email FROM dbo.Emails;
    
    SET @bcc = STUFF(@bcc,1,1,'');
    
    SELECT @bcc;
    
    /*
    EXEC msdb.dbo.sp_send_dbmail
        @profile_name = 'profile name',
        @recipients = 'your address',
        @blind_copy_recipients = @bcc,
        @body = N'body',
        @subject = N'subject';
    */
    

    — If you want to send an individual message to each recipient, use a cursor:

    DECLARE @e VARCHAR(320);
    
    DECLARE e CURSOR LOCAL STATIC FORWARD_ONLY READ_ONLY
        FOR SELECT Email FROM dbo.Emails;
    
    OPEN e;
    
    FETCH NEXT FROM e INTO @e;
    
    WHILE @@FETCH_STATUS = 0
    BEGIN
        PRINT 'Sending to ' + @e;
    
        /*
        EXEC msdb.dbo.sp_send_dbmail
            @profile_name = 'profile name',
            @recipients = @e,
            @body = N'body',
            @subject = N'subject';
        */
    
        FETCH NEXT FROM e INTO @e;
    END
    
    CLOSE e;
    DEALLOCATE e;
    

    Cleanup:

    DROP TABLE dbo.Emails;
    

    Finally, if your list of recipients is large, I’ll suggest you seek other alternatives that are better equipped for bulk mailing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For educational purposes, I need to send an email through an SMTP server, using
I need to send out ~2000 emails via a sendmail server to email addresses
I am trying to launch an Intent to send an email. All of that
I have an email that I send out to subscribers of my site. I
I'm currently working on a project where I need to send an email to
I need to send email notifications to either a group or user on every
i have a simple contact us form and i need to send an email
I need your help. I have a php script to send email to people
Possible Duplicate: Sending HTML email from PHP I need to send an html mail
I need to add a checkbox with text Send a copy of this email

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.