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