CDO.Message.1 error 80070005

P

Pai

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 = "(e-mail address removed)"
objCDO.From = "(e-mail address removed)"
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
 
R

Ray at

http://www.aspfaq.com/5003

Ray at home

Pai said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,250
Latest member
Charlesreero

Latest Threads

Top