1. Introduction 2. Getting Started 3. Attachments 4. Embedded Images 5. Security 6. Unicode 7. Queuing Part I 8. Queuing Part II Object Reference |
Chapter 7. Message Queuing. Part I
Why Use Message Queuing?
AspEmail 5.0 offers the flag Mail.Queue which, if set to True,
instructs the Send method to place a message in a queue
and return immediately, without opening an SMTP session. Your message-sending
ASP script no longer has to wait until a message is sent, which means
a better client-response time and less load on IIS.
AspEmail is shipped with EmailAgent.exe, a Windows
service running in the background, which polls the message queue
and sends out queued messages. EmailAgent 5.0 is capable of opening up
to 64 simultaneous SMTP sessions for quicker processing.
The old method Mail.SendToQueue is still supported for backwards
compatibility, but it is recommended that the sequence
Mail.Queue = True
be used instead (where SendXXX is one of the following methods: Send, SendEncrypted, SendSigned,
and SendSignedAndEncrypted). Unlike older versions, AspEmail 5.0 can queue
encrypted and/or signed messages as well.
AspEmail creates message files in the plain ASCII format, so that they can
be easily viewed and modified by hand, if necessary. A typical file name
looks like this: 20030408-16195159-23c-0.eam-new. Once a message
file is placed in the queue, its name can be retrieved
via the read-only property Mail.QueueFileName.
Double-click on the EmailAgent button. The EmailAgent Control Panel applet will
come on which enables you to configure, launch and shut down EmailAgent.
It also allows you to monitor thread status and view logs.
The General tab displays the current status of the EmailAgent service as a whole
(left pane) and each individual thread (right pane). The Go button
launches the service, Stop stops the service, and Queue displays the content
of the message queue folder.
The Configuration tab contains basic parameters including the message
queue folder, the number of simultaneous SMTP sessions, and others.
Message Queue Path
Simultaneous Sessions
Tip: While it may be tempting to use all 64 threads,
consider the following: if your SMTP server
is configured to limit the total number of simultaneous sessions to, say, 20,
all extra sessions will be dropped, and the corresponding messages returned to the queue for resending.
This will actually slow your system down. Ask your system administrator
how many simultaneous sessions your SMTP server allows, and set this parameter
accordingly.
Poll message queue every ... seconds
Repeat sending after ... minutes
Cancel sending after ... hours
Do not move sent messages to the \Sent folder
The SMTP tab configures SMTP parameters.
Relay through ... Host/Relay through DNS
The address of the recipient's SMTP server is derived from the
recipient's email address by looking up DNS records. DNS relaying is slower
but it does not require the sender to have his/her own SMTP relay server.
Use Authentication
The POP3 and Log tabs will be described in the next chapter.
...
If you wish a message to be delivered in, say, 5 hours, the following code may be used:
Mail.Timestamp = Now() + 5/24 ' dates are measured in days, so 1/24 is one hour
Copyright © 1999 - 2003 Persits Software, Inc. All Rights Reserved Questions? Comments? Write us! |