IIS ASP - Need Help with CDONTS

This is Interesting: Free IT Magazines  
Home > Archive > IIS ASP > March 2007 > Need Help with CDONTS





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Need Help with CDONTS
jlopes151

2007-03-28, 7:16 pm


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\d
madmin_28-MAR-2007\220010.PDF"

Dim objSession
Set objSession = CreateObject ("CDONTS.Session")
objSession.LogonSMTP "Lopes,James", "james.m.lopes@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>

Anthony Jones

2007-03-29, 7:18 am


"jlopes151" <jlopes151@discussions.microsoft.com> wrote in message
news:FD5382B8-F317-4AEA-AED9-31A016BBEFB6@microsoft.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\d
madmin_28-MAR-2007\220010.PDF"
>
> Dim objSession
> Set objSession = CreateObject ("CDONTS.Session")
> objSession.LogonSMTP "Lopes,James", "james.m.lopes@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.


jlopes151

2007-03-29, 1:23 pm



"Anthony Jones" wrote:

>
> "jlopes151" <jlopes151@discussions.microsoft.com> wrote in message
> news:FD5382B8-F317-4AEA-AED9-31A016BBEFB6@microsoft.com...
> with
>
> You need to check both the share permissions and the folder/file permissions
>
> an
> if
>
> 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





Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com