I've accomplished what your attempting to do with this small VB program.
What you need is this.
Create a directory called D:\REMAILER. Then in this directory create a
subdirectory representing the Group of people, say helpdesk. Inside, this
group subdirectory, create a text file with the name of the email address
with a ".a" after it.
D:\REMAILER\HELPDESK\[EMAIL PROTECTED]
D:\REMAILER\HELPDESK\[EMAIL PROTECTED]
The ".a" is for Active. I have an asp page that allows managers to change
it to a ".i" when a person is out for the day so that they are temporarly
inactive.
Anyway, what it does is this. It scans the groups email directory file
looking for the oldest dated email address in the directory. Then it
updates the file with the current date and time. Then sends the message to
that person.
You will also need to build an alias under the groups name and point it to
this program
Alias: HELPDESK Program Command: D:\REMAIL\REMAILER.EXE HELPDESK
-----
Private Sub Main()
On Error Resume Next
Dim CMDLine As String, EMAddr As String, EMDate As Date, EMFile As String
Dim x As Integer, y1 As String, y2 As Date, ktr As Integer
Dim WRKDir As String, MSGFile As String
CMDLine = Command()
x = InStr(1, CMDLine, " ")
If x = 0 Then End
WRKDir = "D:\REMAILER\" & Left(CMDLine, x - 1)
MSGFile = Right(CMDLine, Len(CMDLine) - x)
y1 = Dir(WRKDir & "\*.D")
If y1 <> "" Then
EMAddr = Left(y1, Len(y1) - 2)
EMFile = y1
Else
EMAddr = "[EMAIL PROTECTED]"
EMFile = "[EMAIL PROTECTED]"
End If
EMDate = #1/1/2050#
y1 = Dir(WRKDir & "\*.A")
Do While y1 <> ""
y2 = FileDateTime(WRKDir & "\" & y1)
If y2 < EMDate Then
EMAddr = Left(y1, Len(y1) - 2)
EMDate = y2
EMFile = y1
End If
y1 = Dir
Loop
' update the users file with date and time
Open WRKDir & "\" & EMFile For Output As #1
Print #1, Date & " " & Time
Close #1
' create a que file for Imail
ktr = 0
FileLoop:
Randomize
x = Int((9999 * Rnd) + 1)
Err.Clear
Open "D:\IMAIL\SPOOL\QRemail" & Format(x, "0000") & ".SMD" For Output As
#1
If Err.Number <> 0 Then
ktr = ktr + 1
If ktr > 10 Then End
GoTo FileLoop
End If
Print #1, "Q" & MSGFile
Print #1, "R<" & EMAddr & ">"
Close #1
Shell ("D:\IMAIL\DECLUDE.EXE D:\IMAIL\SPOOL\QRemail" & Format(x, "0000") &
".SMD") ' fire off delivery.
End
End Sub
-Bill Doyle
----- Original Message -----
From: "Guy Isabel" <[EMAIL PROTECTED]>
To: "IMail Forum" <[EMAIL PROTECTED]>
Sent: Sunday, July 29, 2001 1:35 PM
Subject: [IMail Forum] Round-robin delivery
> I'm fishing for ideas about accomplishing the following. Say I have an
> e-mail address named [EMAIL PROTECTED] and there are three people "manning
> the help desk". They have the following individual e-mail addresses:
> [EMAIL PROTECTED], [EMAIL PROTECTED] and [EMAIL PROTECTED]
>
> The obvious question: How can I set things up so that requests sent to
> [EMAIL PROTECTED] are sent to the three people/addresses in a round-robin
> fashion? I take it that [EMAIL PROTECTED] could be a program alias but what
> should the program do? Write to a file a number (1, 2 or 3) to increment
the
> value (modulo 3) and execute IMAIL1.EXE to get it to send the original
> message to [EMAIL PROTECTED]? If so, would the "-f" switch in the
IMAIL1.EXE
> command line point to some temporary file that would indeed contain the
text
> of the request?
>
> Another possible approach could be to have [EMAIL PROTECTED] as a real
> address and somehow programmatically changing the forwarding address on
this
> account to [EMAIL PROTECTED]?
>
> As I said, I'm looking for ideas. Any and All suggestions welcome!
>
> Guy
> --
> Guy Isabel <[EMAIL PROTECTED]>
>
>
>
>
> Please visit http://www.ipswitch.com/support/mailing-lists.html
> to be removed from this list.
>
> An Archive of this list is available at:
> http://www.mail-archive.com/imail_forum%40list.ipswitch.com/
>
Please visit http://www.ipswitch.com/support/mailing-lists.html
to be removed from this list.
An Archive of this list is available at:
http://www.mail-archive.com/imail_forum%40list.ipswitch.com/