473,509 Members | 3,009 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Mailer code sample available? Also - loop & delay question

I've decided to send weekly emails to registered users ("members") on one of
my sites. This will be the first time I attempted anything like this. Now
I know I could use some 3rd party list server services like MailChimp.com or
ConstantContact.com but since this site I have is basically maintained and
developed for free, I want to keep my overhead as low as possible.
Before I actually dive into this and build one from scratch, is there
anything out there that is free or very inexpensive and is written in
ASP/VB.NET? I've tried searching this forum and even google but the problem
is I'm not sure what keyword or phrase to search WITH. However, even if I
do create one from scratch, which does seems fairly achievable, then I have
a "loop" question.

Assuming that I do build one from scratch, I'd like to loop thru all the
members and email them a customized HTML email containing data specifically
for them. So to reduce server strain and possible issues, I'd like to place
a ...let's say....5 second delay within the loop so it sends an email every
5 seconds.

So how would one add a delay in a loop? The only thing I can think of is to
have a variable actually watch the seconds on the system clock ....and that
seems pretty wasteful or resources.

And ideas or thoughts?

Thanks!

Nov 19 '05 #1
4 1660
So how would one add a delay in a loop? The only thing I can think of is to have a variable actually watch the seconds on the system clock ....and that seems pretty wasteful or resources.

And ideas or thoughts?

Thanks!


I have used this to put a process to sleep in milliseconds
In the imports
Imports System.Threading

In the code
thread.sleep(5000)

Mike
Nov 19 '05 #2
Are you using MS SQL? You could schedue a job to run an SProc that uses the
CDO mail object to send out your emails. I have an SProc that you could call
to generate the mails if so. Reply and I will supply if interested...

"D. Shane Fowlkes" wrote:
I've decided to send weekly emails to registered users ("members") on one of
my sites. This will be the first time I attempted anything like this. Now
I know I could use some 3rd party list server services like MailChimp.com or
ConstantContact.com but since this site I have is basically maintained and
developed for free, I want to keep my overhead as low as possible.
Before I actually dive into this and build one from scratch, is there
anything out there that is free or very inexpensive and is written in
ASP/VB.NET? I've tried searching this forum and even google but the problem
is I'm not sure what keyword or phrase to search WITH. However, even if I
do create one from scratch, which does seems fairly achievable, then I have
a "loop" question.

Assuming that I do build one from scratch, I'd like to loop thru all the
members and email them a customized HTML email containing data specifically
for them. So to reduce server strain and possible issues, I'd like to place
a ...let's say....5 second delay within the loop so it sends an email every
5 seconds.

So how would one add a delay in a loop? The only thing I can think of is to
have a variable actually watch the seconds on the system clock ....and that
seems pretty wasteful or resources.

And ideas or thoughts?

Thanks!


Nov 19 '05 #3
Yes I am. That would be GREAT!

--
"keithinsac" <ke********@discussions.microsoft.com> wrote in message
news:87**********************************@microsof t.com...
Are you using MS SQL? You could schedue a job to run an SProc that uses
the
CDO mail object to send out your emails. I have an SProc that you could
call
to generate the mails if so. Reply and I will supply if interested...

"D. Shane Fowlkes" wrote:
I've decided to send weekly emails to registered users ("members") on one
of
my sites. This will be the first time I attempted anything like this.
Now
I know I could use some 3rd party list server services like MailChimp.com
or
ConstantContact.com but since this site I have is basically maintained
and
developed for free, I want to keep my overhead as low as possible.
Before I actually dive into this and build one from scratch, is there
anything out there that is free or very inexpensive and is written in
ASP/VB.NET? I've tried searching this forum and even google but the
problem
is I'm not sure what keyword or phrase to search WITH. However, even if
I
do create one from scratch, which does seems fairly achievable, then I
have
a "loop" question.

Assuming that I do build one from scratch, I'd like to loop thru all the
members and email them a customized HTML email containing data
specifically
for them. So to reduce server strain and possible issues, I'd like to
place
a ...let's say....5 second delay within the loop so it sends an email
every
5 seconds.

So how would one add a delay in a loop? The only thing I can think of is
to
have a variable actually watch the seconds on the system clock ....and
that
seems pretty wasteful or resources.

And ideas or thoughts?

Thanks!


Nov 19 '05 #4
Here you go, FYI this must be run under an account that has admin privs for
creation of the OA object

CREATE PROCEDURE sp_SMTPemail
(
@From as nvarchar(50)
,@To as nvarchar(50)
,@Subject as nvarchar(255)
,@Body as text
) --WITH ENCRYPTION--
AS
-- Declare
DECLARE @message int
DECLARE @config int
DECLARE @hr int
DECLARE @src varchar(255), @desc varchar(255)
SET @hr = 0

EXEC @hr = sp_OACreate 'CDO.Message', @message OUT -- create the message
object
EXEC @hr = sp_OACreate 'CDO.Configuration', @config OUT -- create the
configuration object
-- Configuration Object
EXEC @hr = sp_OASetProperty @config, 'Fields(cdoSendUsingMethod)',
'cdoSendUsingPort' -- Send the message using the network
EXEC @hr = sp_OASetProperty @config, 'Fields(cdoSMTPServer)',
'your.server.com' -- SMTP Server
EXEC @hr = sp_OASetProperty @config, 'Fields(cdoSMTPServerPort)', 25 --
Server SMTP Port
EXEC @hr = sp_OASetProperty @config, 'Fields(cdoSMTPAuthenticate)',
'cdoAnonymous' -- Anonymous SMTP Authenticate
EXEC sp_OAMethod @config, 'Fields.Update'
-- Message Object
EXEC @hr = sp_OASetProperty @message, 'Configuration', @config -- set
message.configuration = config
EXEC @hr = sp_OASetProperty @message, 'To', @To
EXEC @hr = sp_OASetProperty @message, 'From', @From
EXEC @hr = sp_OASetProperty @message, 'Subject', @Subject
EXEC @hr = sp_OASetProperty @message, 'bodyformat',0
EXEC @hr = sp_OASetProperty @message, 'MailFormat',0
EXEC @hr = sp_OASetProperty @message, 'HTMLBody', @Body
EXEC sp_OAMethod @message, 'Send()'
-- Destroys the objects
EXEC @hr = sp_OADestroy @message
EXEC @hr = sp_OADestroy @config

-- Errorhandler
IF @hr <> 0
BEGIN
EXEC sp_OAGetErrorInfo @message, @src OUT, @desc OUT
SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc
-- log and/or handle the error here if there is one...
RETURN
END
GO
"D. Shane Fowlkes" wrote:
Yes I am. That would be GREAT!

--
"keithinsac" <ke********@discussions.microsoft.com> wrote in message
news:87**********************************@microsof t.com...
Are you using MS SQL? You could schedue a job to run an SProc that uses
the
CDO mail object to send out your emails. I have an SProc that you could
call
to generate the mails if so. Reply and I will supply if interested...

"D. Shane Fowlkes" wrote:
I've decided to send weekly emails to registered users ("members") on one
of
my sites. This will be the first time I attempted anything like this.
Now
I know I could use some 3rd party list server services like MailChimp.com
or
ConstantContact.com but since this site I have is basically maintained
and
developed for free, I want to keep my overhead as low as possible.
Before I actually dive into this and build one from scratch, is there
anything out there that is free or very inexpensive and is written in
ASP/VB.NET? I've tried searching this forum and even google but the
problem
is I'm not sure what keyword or phrase to search WITH. However, even if
I
do create one from scratch, which does seems fairly achievable, then I
have
a "loop" question.

Assuming that I do build one from scratch, I'd like to loop thru all the
members and email them a customized HTML email containing data
specifically
for them. So to reduce server strain and possible issues, I'd like to
place
a ...let's say....5 second delay within the loop so it sends an email
every
5 seconds.

So how would one add a delay in a loop? The only thing I can think of is
to
have a variable actually watch the seconds on the system clock ....and
that
seems pretty wasteful or resources.

And ideas or thoughts?

Thanks!



Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5301
by: John Davis | last post by:
What is the **MOST** obvious reason why will this will fail (it's not syntax or anything specific to the object)? Function Mail(MailerProgram, Message, Subject, Format, FromEmail, ToEmail,...
0
1447
by: BS | last post by:
Hi All, This may be an old question, but there's little useful references online that I've been able to find. I want the following code to display bit by bit, not send all at once to the...
1
1306
by: DiskMan | last post by:
System: Redhat 7.2 Kernel-2.6.11.8 GCC-3.4.3 CCC-6.5.9 Binutils-2.15 Make-3.80 GTK/GLIB-2.6.7 For some reason my Linux box is suddenly having issues trying to read ;
1
1625
by: javascript | last post by:
I need to modify a code in Java Script for a Form Mailer page (asp), to be used for online newsletter subscriptions. So long, CDONTS had been playing an important role here, but since SMTP...
4
3131
by: Al G | last post by:
Has anyone played with MS's SMTP sample, mailer.exe? I downloaded the sample, and ran it, but keep getting the error "Failure sending mail". Where might I look for more information? Maybe some...
4
4240
by: jmarcrum | last post by:
I have to modify this assembly code in order to make it use interrupts. Right now, when I push button 1 on the microprocessor the count increments once (the LED's count in binary, using only 3 LED's...
6
26317
by: Dave Kelly | last post by:
Sorry for the long post, it is easier to discard information than to have to wait for it to arrive. So here goes: This code worked perfectly when I was an Earthlink customer. Sprint decided...
5
3847
by: vamsioracle | last post by:
Hi all, I have a problem with the ult_smtp package. Let me explain how the structure of my code is procedure------------ begin declarations of variables and cursors...
3
4689
ddtpmyra
by: ddtpmyra | last post by:
Below is the scripts that triggered everytime users update the database and send a blast of emails to the user group. The problem is the email goes to JUNK folder and I wonder though I use the...
0
7136
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7344
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7505
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5652
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5060
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4730
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3203
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1570
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
775
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.