Need Help with CDONTS

J

jlopes151

Here the sample code, it fails on the attachment retrieving the file.
The file is located on a remote server. The folder is Shared & Web Shared with
EveryOne having Full access to the shared folder. I can pull the file from
other
ways, dropping the full path in the Run of Windows, Using Outlook to send an
e-mail with the file attached

I get one of those Unspecified error messages. By the way this code works if
the file is local. I need to access the file from the remote location.

<script language="VBScript">

public function testMsg()

Dim objNewMsg' as Message
Dim ObjAttach' as Attachments
Dim objOutbox
Dim sName
Dim sPath

sName = "220010.PDF"
sPath =
"\\NTGDOCPP04\wwwroot\dcv2_reports\temp\dmadmin_28-MAR-2007\220010.PDF"

Dim objSession
Set objSession = CreateObject ("CDONTS.Session")
objSession.LogonSMTP "Lopes,James", "(e-mail address removed)"

Set objOutbox = objSession.GetDefaultFolder(2) ' CdoDefaultFolderOutbox
Set objNewMsg = objOutbox.Messages.Add("The Send Message" )
Set ObjAttach = objNewMsg.Attachments.Add(sName, 1, sPath)
'logText_js("Passed testMsg function ")
end function

</script>
 
A

Anthony Jones

jlopes151 said:
Here the sample code, it fails on the attachment retrieving the file.
The file is located on a remote server. The folder is Shared & Web Shared with
EveryOne having Full access to the shared folder.

You need to check both the share permissions and the folder/file permissions
I can pull the file from
other
ways, dropping the full path in the Run of Windows, Using Outlook to send an
e-mail with the file attached

I get one of those Unspecified error messages. By the way this code works if
the file is local. I need to access the file from the remote location.

<script language="VBScript">

public function testMsg()

Dim objNewMsg' as Message
Dim ObjAttach' as Attachments
Dim objOutbox
Dim sName
Dim sPath

sName = "220010.PDF"
sPath =
"\\NTGDOCPP04\wwwroot\dcv2_reports\temp\dmadmin_28-MAR-2007\220010.PDF"

Dim objSession
Set objSession = CreateObject ("CDONTS.Session")
objSession.LogonSMTP "Lopes,James", "(e-mail address removed)"

Set objOutbox = objSession.GetDefaultFolder(2) ' CdoDefaultFolderOutbox
Set objNewMsg = objOutbox.Messages.Add("The Send Message" )
Set ObjAttach = objNewMsg.Attachments.Add(sName, 1, sPath)
'logText_js("Passed testMsg function ")
end function

</script>

What OS are you on? If Win2000 or Win2003 consider using CDOSYS instead of
CDONTS. CDONTS is deprecated.
 
J

jlopes151

Anthony Jones said:
You need to check both the share permissions and the folder/file permissions


What OS are you on? If Win2000 or Win2003 consider using CDOSYS instead of
CDONTS. CDONTS is deprecated.

The Web user at the Share level has Read acceess, full control at the file
level
Only the parent folder is Shared with the child folders giving full control
at their
levels

Win2000 SP4
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top