473,788 Members | 2,800 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 1675
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.Threadin g

In the code
thread.sleep(50 00)

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********@dis cussions.micros oft.com> wrote in message
news:87******** *************** ***********@mic rosoft.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.Configurat ion', @config OUT -- create the
configuration object
-- Configuration Object
EXEC @hr = sp_OASetPropert y @config, 'Fields(cdoSend UsingMethod)',
'cdoSendUsingPo rt' -- Send the message using the network
EXEC @hr = sp_OASetPropert y @config, 'Fields(cdoSMTP Server)',
'your.server.co m' -- SMTP Server
EXEC @hr = sp_OASetPropert y @config, 'Fields(cdoSMTP ServerPort)', 25 --
Server SMTP Port
EXEC @hr = sp_OASetPropert y @config, 'Fields(cdoSMTP Authenticate)',
'cdoAnonymous' -- Anonymous SMTP Authenticate
EXEC sp_OAMethod @config, 'Fields.Update'
-- Message Object
EXEC @hr = sp_OASetPropert y @message, 'Configuration' , @config -- set
message.configu ration = config
EXEC @hr = sp_OASetPropert y @message, 'To', @To
EXEC @hr = sp_OASetPropert y @message, 'From', @From
EXEC @hr = sp_OASetPropert y @message, 'Subject', @Subject
EXEC @hr = sp_OASetPropert y @message, 'bodyformat',0
EXEC @hr = sp_OASetPropert y @message, 'MailFormat',0
EXEC @hr = sp_OASetPropert y @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_OAGetErrorIn fo @message, @src OUT, @desc OUT
SELECT hr=convert(varb inary(4),@hr), Source=@src, Description=@de sc
-- 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********@dis cussions.micros oft.com> wrote in message
news:87******** *************** ***********@mic rosoft.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
5316
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, ReplyTo, FromName, ToName, MailerPath, BCCEmail, Attachement) Set Mailer = Server.CreateObject("Persits.MailSender") if NOT isObject(Mailer) Then Mail = false Exit function
0
1454
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 client (IE). The following code sample works as intended on all NT4 Wkstation PWS and on *one* IIS6 W2K3 server. On all other W2K3 servers it does not, it waits and
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
1636
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 relay restrictions have been implemented by my web hosting company to avoid any ABUSE (phishing/spoofing etc. ) using their servers, the code of my page needs to be changed (CDONTS will no longer work). So, I need a sample code without using...
4
3139
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 troubleshooting tips? Thanks in advance, you folks have helped with some of my other projects, simply by answering someone else's question. Al G
4
4263
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 and only counting to 7 in binary). The second button on the microprocessor, when pushed, resets the count. I have the addreses for both button in the code. However, my trouble is modifying this code. I HAVE to use interrupts. I need a lot...
6
26387
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 not to pardner with Earthlink and create their own IP. Since then everything email has been broke. Sprint/Embarq is the only copper wire DSL provider where I live.
5
3866
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
4710
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 company STMP and company email. Any idea how to this happened? #email process starts here require("class.phpmailer.php"); $mail = new PHPMailer(); $mail->From = "xxx@xxx.com"; $mail->FromName = "adminr"; $mail->Subject = "New Document";...
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10364
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9967
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7517
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3670
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.