[thelist] SMTP/IIS5: how to filter and efficiently send e-mail
darren
darren at web-bitch.co.uk
Thu Jun 27 13:26:01 CDT 2002
On Thursday, June 27, 2002 at 19:03, Chris W. Parker wrote:
CWP> 2. i'm looking for an article that i once read about using FSO to send
CWP> email instead of the CDONTS. for example instead of creating the email
CWP> through script you write a text file to an SMTP directory so that server
CWP> can take care of the mail at it's own pace. as it stands now, i'm trying
CWP> to send up to five emails one right after the in an .asp file. however
CWP> only the first one is coming through and i think it might be because
CWP> they are being fired too quickly. does anyone know what article i'm
CWP> talking about? or be able to give me instructions (example) on how i can
CWP> use the FSO to do this?
if you're running on win2K you can get CDO to do this for you. something
like (watch for wrapping):
' include this at the top of your file:
<!--metadata type="typelib" uuid="CD000000-8B95-11D1-82DB-00C04FB1625D" name="CDO for Windows 2000 Type Library" -->
set objEmail = Server.CreateObject("CDO.Message")
set objConf = Server.CreateObject("CDO.Configuration")
set objFields = objConf.Fields
objFields.Item(cdoSendUsingMethod) = cdoSendUsingPickup
objFields.Item(cdoSMTPServerPickupDirectory) = "d:\inetpub\mailroot\Pickup"
objFields.Item(cdoFlushBuffersOnWrite) = true
' if you want to send via a port...
' objFields.Item(cdoSendUsingMethod) = cdoSendUsingPort
' objFields.Item(cdoSMTPServer) = "your smtp server here"
' if you need to authenticate
' objFields.Item(cdoSMTPAuthenticate) = cdoBasic
' objFields.Item(cdoSendUserName) = ""
' objFields.Item(cdoSendPassword) = ""
objFields.Item(cdoSendUserReplyEmailAddress) = sFrom
objFields.Item(cdoSendEmailAddress) = sFrom
objFields.Update
set objEmail.Configuration = objConf
objEmail.From = sFrom
objEmail.Subject = sSubject
if len(sAttach) > 0 then objEmail.AddAttachment sAttach
if inStr(lcase(sEmail), "<html") > 0 then objEmail.HTMLBody = sEmail else objEmail.TextBody = sEmail
objEmail.To = """" & strToName & """ <" & strToAddress & ">"""
objEMail.Send
set objEmail = nothing
set objFields = nothing
set objConf = nothing
the documentation on msdn is pretty good for this.
hth,
darren.
More information about the thelist
mailing list