472,127 Members | 1,424 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,127 software developers and data experts.

Need Help with CDONTS


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\dmadmi n_28-MAR-2007\220010.PDF"

Dim objSession
Set objSession = CreateObject ("CDONTS.Session")
objSession.LogonSMTP "Lopes,James", "ja***********@accenture.com"

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>

Mar 28 '07 #1
2 1798

"jlopes151" <jl*******@discussions.microsoft.comwrote in message
news:FD**********************************@microsof t.com...
>
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\dmadmi n_28-MAR-2007\220010.PDF"

Dim objSession
Set objSession = CreateObject ("CDONTS.Session")
objSession.LogonSMTP "Lopes,James", "ja***********@accenture.com"

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.
Mar 29 '07 #2


"Anthony Jones" wrote:
>
"jlopes151" <jl*******@discussions.microsoft.comwrote in message
news:FD**********************************@microsof t.com...

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\dmadmi n_28-MAR-2007\220010.PDF"

Dim objSession
Set objSession = CreateObject ("CDONTS.Session")
objSession.LogonSMTP "Lopes,James", "ja***********@accenture.com"

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.
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

Mar 29 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Marty | last post: by
2 posts views Thread by microsoft.public.dotnet.languages.csharp | last post: by
8 posts views Thread by Johnfli | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.