Need Help with CDONTS

Discussion in 'ASP General' started by jlopes151, Mar 28, 2007.

  1. jlopes151

    jlopes151 Guest

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

    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>
     
    jlopes151, Mar 28, 2007
    #1
    1. Advertising

  2. "jlopes151" <> wrote in message
    news:...
    >
    > 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", ""
    >
    > 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.
     
    Anthony Jones, Mar 29, 2007
    #2
    1. Advertising

  3. jlopes151

    jlopes151 Guest

    "Anthony Jones" wrote:

    >
    > "jlopes151" <> wrote in message
    > news:...
    > >
    > > 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", ""
    > >
    > > 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
     
    jlopes151, Mar 29, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ammar

    HELP ASP/CDONTS

    Ammar, Jun 6, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    543
    Kevin Spencer
    Jun 7, 2004
  2. Vanessa Lee
    Replies:
    2
    Views:
    414
    Vanessa Lee
    Feb 25, 2006
  3. Vanessa Lee
    Replies:
    0
    Views:
    114
    Vanessa Lee
    Feb 24, 2006
  4. Replies:
    6
    Views:
    185
  5. Replies:
    4
    Views:
    131
    Grant Wagner
    Jan 17, 2005
Loading...

Share This Page