dammansky
March 15th, 2001, 08:47 AM
Hi,
I have a program that has to do the following: look into a mailbox and save the attachment of a mail that hasn't been read yet.
The mailing system i use is Group wise(novell).
Here is the code i use:
Dim str as string
Dim OldInd as Long
Dim APath as string
Dim AFile as string
MAPS.Action = 1
MAPM.SessionID = MAPS.SessionID
With MAPM
.Fetch
If .MsgCount > 0 then
If Not .MsgRead then
OldInd = .MsgIndex
.Copy
Path = .AttachmentPathName
AFile = .AttachmentName
FileCopy Path, "e:\ewb\mail\income\" & AFile
.MsgIndex = OldInd
End If
While .MsgIndex < .MsgCount - 1
.MsgIndex = .MsgIndex + 1
If Not .MsgRead then
OldInd = .MsgIndex
.Copy
Path = .AttachmentPathName
AFile = .AttachmentName
FileCopy Path, "c:\mail\" & AFile
.MsgIndex = OldInd
End If
Wend
End If
End With
MAPS.SignOff
This all works fine: it goes over all the mails ive received and saves the attachments.
But here comes my problem: It looks in my own mailbox. I want it to look in the mailbox of user Test. So ive put the username to "Test" in the mapisession and now i have the following situation:
When i have a groupwise session open under my name, it just reads my mailbox. When i have no groupwise session open it asks the password for the user "Test".
I would like to read the "Test" mailbox when my mailbox is open.
Could anybody help me please.
Thanks in advance
I have a program that has to do the following: look into a mailbox and save the attachment of a mail that hasn't been read yet.
The mailing system i use is Group wise(novell).
Here is the code i use:
Dim str as string
Dim OldInd as Long
Dim APath as string
Dim AFile as string
MAPS.Action = 1
MAPM.SessionID = MAPS.SessionID
With MAPM
.Fetch
If .MsgCount > 0 then
If Not .MsgRead then
OldInd = .MsgIndex
.Copy
Path = .AttachmentPathName
AFile = .AttachmentName
FileCopy Path, "e:\ewb\mail\income\" & AFile
.MsgIndex = OldInd
End If
While .MsgIndex < .MsgCount - 1
.MsgIndex = .MsgIndex + 1
If Not .MsgRead then
OldInd = .MsgIndex
.Copy
Path = .AttachmentPathName
AFile = .AttachmentName
FileCopy Path, "c:\mail\" & AFile
.MsgIndex = OldInd
End If
Wend
End If
End With
MAPS.SignOff
This all works fine: it goes over all the mails ive received and saves the attachments.
But here comes my problem: It looks in my own mailbox. I want it to look in the mailbox of user Test. So ive put the username to "Test" in the mapisession and now i have the following situation:
When i have a groupwise session open under my name, it just reads my mailbox. When i have no groupwise session open it asks the password for the user "Test".
I would like to read the "Test" mailbox when my mailbox is open.
Could anybody help me please.
Thanks in advance