Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 sending mail in blocks

Author  Topic 

Etymon
Starting Member

6 Posts

Posted - 2007-06-12 : 13:23:44
I need to find a way to send mail in blocks of 100 and 500 at intervals of 120 seconds. Does anyone know of any code for this?

Thanks!

Etymon

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-06-12 : 13:25:26
blocks of what?
from where?


_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

Etymon
Starting Member

6 Posts

Posted - 2007-06-12 : 13:36:04
I didn't say that correctly did I? Thanks.

I'll leave off the 500 since the amount is not really what I am after.

I want to send 100 email addresses at a time at intervals of 120 seconds between each sending. For instance, when a form is submitted, the process is automated through each interval until all of the e-mails have been sent. This is for a Snitz forum so it would be using a file kind of like admin_emaillist.asp but modified with a form having a subject and a message field to send email to all of the forum's members.
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-06-12 : 13:39:17
and this has what to do with sql server?
what exactly is your problem?

there are a few asp mail send api's out here.
google them up.

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

Etymon
Starting Member

6 Posts

Posted - 2007-06-12 : 14:08:13
Apart from automating this for every 120 seconds, I'm having a problem with a query. It seems to be giving me duplicate records when I only want the remaining records.

If I have 155 records and I want two sets of 100 yet the second set I only want to be the remaining 55, the query below still gives me 100 records except it is giving me additional records that I already have.

The problem I am having is that the second query for the second set of 100 is selecting the Topic IDs from largest to smallest and then the outer query is selecting from largest to smallest and then sorting them from smallest to largest. However, the first query for the first 100 is selecting from smallest to largest and sorting from smallest to largest. This is creating a union of the two sets of 100 creating an overlap in returned Topic IDs.

SELECT * FROM (
SELECT TOP 100 TOPIC_ID
FROM (SELECT TOP 200 TOPIC_ID
FROM FORUM_TOPICS AS NEXT_200_TOPICS
ORDER BY TOPIC_ID) AS FORUM_TOPICS
ORDER BY TOPIC_ID DESC
) As T2
Order by TOPIC_ID ASC;
Go to Top of Page
   

- Advertisement -