CDO.Message.1 error 80070005

Discussion in 'ASP General' started by Pai, Dec 6, 2003.

  1. Pai

    Pai Guest

    Hello there,

    I am trying to send a attachemnt using CDO

    when I try to attach a file to the message, I get the error

    CDO.Message.1 error 80070005

    Access denied

    It sends the email but I get a .dat file in the attachement and gives me eroor

    If I send an email without attachment it works fine...

    Do I need to do some settting to go about this

    the code is as below

    Dim mail_Subject
    mail_Subject = Request.Form("TextSubject")
    Dim mail_Body
    mail_Body = Request.Form("TextBody")
    Dim file_Attach
    file_Attach = Request.Form("FileAttach")

    Dim objCDO
    Set objCDO = Server.CreateObject("CDO.Message")

    Set objConfig = CreateObject("CDO.Configuration")
    'Configuration:
    Set Flds = objConfig.Fields

    Flds("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    Flds("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "111.11.1.11"
    Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
    Flds("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60


    Flds.Update

    Set objCDO.Configuration = objConfig

    objCDO.To = ""
    objCDO.From = ""
    objCDO.Subject = mail_Subject

    objCDO.HTMLBody = mail_Body


    objCDO.AddAttachment file_Attach ' erroe line
    objCDO.Send()

    set objConfig = nothing
    set objCDO = nothing

    Thanks in advance,
    Srikanth
    Pai, Dec 6, 2003
    #1
    1. Advertising

  2. Pai

    Ray at Guest

    http://www.aspfaq.com/5003

    Ray at home

    "Pai" <> wrote in message
    news:...
    > Hello there,
    >
    > I am trying to send a attachemnt using CDO
    >
    > when I try to attach a file to the message, I get the error
    >
    > CDO.Message.1 error 80070005
    >
    > Access denied
    >
    > It sends the email but I get a .dat file in the attachement and gives me

    eroor
    >
    > If I send an email without attachment it works fine...
    >
    > Do I need to do some settting to go about this
    >
    > the code is as below
    >
    > Dim mail_Subject
    > mail_Subject = Request.Form("TextSubject")
    > Dim mail_Body
    > mail_Body = Request.Form("TextBody")
    > Dim file_Attach
    > file_Attach = Request.Form("FileAttach")
    >
    > Dim objCDO
    > Set objCDO = Server.CreateObject("CDO.Message")
    >
    > Set objConfig = CreateObject("CDO.Configuration")
    > 'Configuration:
    > Set Flds = objConfig.Fields
    >
    > Flds("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    > Flds("http://schemas.microsoft.com/cdo/configuration/smtpserver") =

    "111.11.1.11"
    > Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
    >

    Flds("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout")
    = 60
    >
    >
    > Flds.Update
    >
    > Set objCDO.Configuration = objConfig
    >
    > objCDO.To = ""
    > objCDO.From = ""
    > objCDO.Subject = mail_Subject
    >
    > objCDO.HTMLBody = mail_Body
    >
    >
    > objCDO.AddAttachment file_Attach ' erroe line
    > objCDO.Send()
    >
    > set objConfig = nothing
    > set objCDO = nothing
    >
    > Thanks in advance,
    > Srikanth
    Ray at, Dec 6, 2003
    #2
    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. NvrBst
    Replies:
    1
    Views:
    349
    NvrBst
    Nov 20, 2007
  2. Fredrik Nilsson

    Server object error 'ASP 0178 : 80070005'

    Fredrik Nilsson, Apr 3, 2004, in forum: ASP .Net Security
    Replies:
    0
    Views:
    107
    Fredrik Nilsson
    Apr 3, 2004
  3. Fredrik Nilsson

    Server object error 'ASP 0178 : 80070005'

    Fredrik Nilsson, Apr 3, 2004, in forum: ASP General
    Replies:
    1
    Views:
    419
    Aaron Bertrand [MVP]
    Apr 3, 2004
  4. Bohous
    Replies:
    1
    Views:
    197
    Jeff Cochran
    Sep 2, 2005
  5. Michael Bender

    Method not allowed(Error code = 80070005)

    Michael Bender, Oct 19, 2007, in forum: ASP General
    Replies:
    3
    Views:
    131
    Bob Barrows [MVP]
    Oct 19, 2007
Loading...

Share This Page